React Native DOM
At React Europe last week though, we were lucky to hear from Vincent Riemer talking about his experimental, comprehensive port of React Native to the web.
What Vincent focused on was to uniform the development process and the tools between Mobile and Web platforms. He ended up filling the gaps between the two with Yoga (cross-platform layout engine which implements Flexbox) and by compiling it to Web Assembly.
Here are the differences between the two:
react-native-dom on GitHub
- Multithreaded by default: Following the exact same architecture as React Native on mobile, all of your react components/app logic are run in web worker, leaving the main thread to entirely focus on rendering.
- Same layout behavior as React Native on mobile: Powered by custom bindings to Yoga and compiled to Web Assembly, avoid layout inconsistencies between your native and web projects.
- Built with the same bundler used for existing React Native platforms: Build both the "native" main and JS threads with the Metro Bundler along with all the developer experience features it provides.
- Ecosystem compatible escape hatch to the DOM: Using the same native module bridge, expose DOM-specific APIs in a more generic way that can easily be made into a cross-platform module.