4 ms·
Thanks for putting the effort. Though my knowledge is limited but I don't get this. Why React is different from React Native? Ideally web should be another targ
by drieddust 10y ago
Thanks for putting the effort. Though my knowledge is limited but I don't get this. Why React is different from React Native? Ideally web should be another target just like iOS or Android.
- dabbott 10y agoThe "React" part is the same regardless of web or native. But there are a lot of other concerns for web (css, DOM stuff, and integrating libraries that use those two). Ideally web is just another taraget :) https://github.com/necolas/react-native-web https://github.com/necolas/react-native-web That said, while writing a website with react-native-web is potentially interesting for new sites, it can be less worthwhile for an existing site to just embed a little bit (which is one of the huge values of React). It's also still very experimental. But I suspect it will be supported in a huge way soon.
- spicyj 10y agoReact DOM is a sibling of React Native that integrates directly with web APIs and allows you to use <div /> and <span /> directly instead of RN APIs like <View />. You're correct that there's no theoretical reason that RN apps can't run on the web; as dabbott mentions, react-native-web is one third-party attempt at this. We'd like to support this officially one day but don't currently have a high-quality solution we can recommend.