简体   繁体   中英

Is react-native good for both web development and mobile development

I have to do a project that includes a mobile app and a web app. So I choose the React.js for the web application and the react-native for the mobile app. Both mobile and web have the same functionalities. If I choose react native for both, is it better or not.

As well as I want to know, although the functionalities of mobile and web app are different, is it better to use React Native for both?

It depends on your requirements and choice.

React Native supports for the Web from version >= 0.60. If both of your mobile application and Web application will have almost the same features, then go for React Native for Web . Then you can write your code once and use it on all Android, iOS, and Web platforms. You can save your time a lot in that case.

But, if your web application will have different functionalities, I recommend you to go with React JS. You can use wonderful libraries such as material-ui for your UI designs.

Like that, both options have pros and cons. So, it depends on your requirements and choice.

React Native for Web can allow you to run the same codebase you use iOS/Android to also run on web. What is does is to add relatively thin compatibility layer on top of outputted DOM elements that simulates the behaviour natively implemented by iOS/Android. Typical use-case would be to run the same codebase on web and mobile. There are of course certain limitations of that compatibility layer as not all mobile features can be easily replicated in the browser.

In case you are building different kind of app for web than for mobile, then you should be better of with regular React, as it will give you full control over generated DOM.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM