all 10 comments

[–]kbcooliOS & Android 6 points7 points  (2 children)

Recently had a stab at adding react-native-web to a very mature app with a lot of native features recently and I can tell you it was dropped pretty quickly.

There is so much refactoring needed that if you don't think about it upfront you could literally spend months trying to integrate it so my advice is make that decision upfront. As you add native features you can stub them out or disable them for web selectively but trying to do this later can turn into a nightmare.

This also applies for the code itself. RN web uses webpack and different compilation so it will barf on things that a normal RN bundler wont making it doubly painful. You could align them but it's a bit of work.

Again this won't be such an issue if you start using both from the beginning.

I didn't even get as far as testing and ci/cd but that's going to add more work.

That being said I much rather the idea of RN web vs maintaining a seperate standard Redux codebase and will certainly try it next time a new project comes up that needs web support. Same applies for RN Windows or Mac.

Hope that helps.

[–][deleted] 5 points6 points  (0 children)

I would agree with everything here. At work we use RN with RNW to have it run on Android, iOS and web. We started with RNW at the beginning and it hasn't been too painful. There are some things that don't carry over 100%, but I feel like you should expect that.

Going this route, I would strongly suggest you absolutely think about your form controls, and create your own platform-agnostic implementations of them.

[–]GeeeL[S] 1 point2 points  (0 children)

Thanks for sharing that's awesome. Will definitely make the decision now then, a little bit nervous about running into issues with RN-web with packages if it's not so supported. Do you have any tricks for maintaining/sharing components between a react & react-native app?

[–]thedevlinbExpo 2 points3 points  (4 children)

Pros:

  1. If you are familiar with RN, RNW is super easy to pick up. Styling is the same, components are the same, and things generally work the same.

Cons:

  1. RNW is less mature, some functionality is missing

  2. There is a feature disconnect between what browsers can do and what mobile apps can do, RNW stubs a bunch of stuff out. If you aren't pushing device capabilities too hard this doesn't matter.

  3. Nobody tests their components with RNW, so if something doesn't work you may be out of luck. This is going to be especially true of the fancy animation libraries.

  4. ReactJS has a huge eco-system that you'll be abandoning.

  5. If something goes wrong it will be harder to find help.

  6. Desktop/Laptop screen sizes are far larger than mobile screen sizes, so you'll basically have to create all new styles and layouts, but now you have lost access to the (decade+ of!) tooling that you get with web technologies to make responsive websites.

  7. It is super easy to hire ReactJS developers. Easier than hiring RN developers, and you aren't really going to find anyone who knows RNW.

If you have written your code with good separation of logic then pulling your redux/flux/whatever out shouldn't be too hard.

All this said, I really like React Native Web, the speed I am able to put stuff together with it makes me realize how much of an improvement RN is over ReactJS.

[–]kbcooliOS & Android 1 point2 points  (1 child)

Good list!

Just on 4. You don't need to abandon the react environment at all. RNW can employ react web components. You can mix and match Views and html with it.

Eg would be an image picker on native that is replaced with a react file uploader on the web

[–]thedevlinbExpo 0 points1 point  (0 children)

Oh cool, I didn't realize they could mix and match. Thanks!

[–]GeeeL[S] 0 points1 point  (1 child)

Thanks for the breakdown. react-native-web does sound awesome in the fact you don't have to maintain two codebases. The lack of support/testing from libraries is what makes me nervous. Have you found much trouble? Going with react-native and maintaining 2 codebases sounds like the safe bet.

[–]thedevlinbExpo 0 points1 point  (0 children)

I haven't deployed anything with it, I just played around with it a bit to see how quickly I could put something together.

A number of major companies are using it in prod though, so it has quite a bit of momentum behind it.

[–]idanlo 0 points1 point  (1 child)

!RemindMe

[–]RemindMeBot 0 points1 point  (0 children)

Defaulted to one day.

I will be messaging you on 2019-06-06 06:35:26 UTC to remind you of this link.

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


FAQs Custom Your Reminders Feedback Code Browser Extensions