top | item 17315453

(no title)

spicyj | 7 years ago

Hi! I'm the author. Let me know if you have questions that aren't covered in the post.

discuss

order

mephitix|7 years ago

Hi - What's the latest philosophy/best practices on interop with React web?

Is the philosophy still 'learn once write everywhere'? There are so many different approaches now to reuse React Native with React, like react-native-web and react-native-dom, it's confusing.

Some of those solutions are non-starters for me since I started with a React webapp and want to now have a React Native app that shares most of my existing code.

My gut feeling is just stick with HOCs, SFCs, proper isolation of the views and I'll be able to share the bulk of things like action creators, reducers, etc. Is this reasonable? Are there other good practices?

spicyj|7 years ago

Your plan of sharing business logic sounds good. We don't currently have any recommended way to share code between web and iOS/Android, although I'm hopeful we will at some point in the future.

rpeden|7 years ago

For sharing code (even view code) between React Native and React web projects, also consider Microsoft's ReactXP project[1]. It is very actively developed and might be what you're looking for.

[1] https://github.com/Microsoft/reactxp

akavel|7 years ago

Could you possibly say in more detail where in the RN codebase can I find the exact code which generates the "single JSON message that lists mutations to perform" that you claim? I'm super interested and desperately trying to pinpoint it, but I'm having really serious trouble with that :(

(Cross-posted this question to: https://stackoverflow.com/q/50873408)

(I've already asked this in a post on the parent thread, but I let myself copy it here in hope there may be higher chance you'll read it that way...)

Jonovono|7 years ago

Awesome, thanks for posting this! Been hearing/reading some of the claims that FB is done supporting RN and it got me spooked :p

We've been working on a RN project [1] for the list 6 months or so. Although it's been a bumpy ride - overall I have loved it. RN mixed with Firebase has been an awesome experience.

[1]: https://itunes.apple.com/us/app/bunch-group-video-chat-games...

ItsMe000001|7 years ago

I already posted a comment before seeing your question, so here is just the main point:

Will React Native finally support exchanging BINARY data (ArrayBuffer, TypedArray) across the bridge?

dman|7 years ago

Any plans for desktop support? (especially Linux)

spicyj|7 years ago

No concrete plans, but I'd love to see it happen someday!

empyrical|7 years ago

Is there any of this new architecture on the master branch yet? I am currently working on a React Native renderer and would like to try and make sure it will be compatible with this re-architecture.

spicyj|7 years ago

Most of the code is in the repo in React/Fabric/ and ReactCommon/fabric/ but unfortunately it's not runnable yet due to some missing dependencies that aren't currently in the open source repo.

empyrical|7 years ago

Will the ability to make synchronous JS calls allow for something like preventDefault() on events?

spicyj|7 years ago

Yes, we'll likely support some form of this. It's important for controlled native components too (ex: text inputs).