Search code examples
reactjsreact-nativereact-native-web

Can I develop web application using React Native?


I don't have any exercise with React Native, so I am considering it as a next technology to learn.

I know that it's a replacement for native Android and iOS apps, but I wonder, in the same time does the application developed with React Native, works as a web application as well?

I found React Native Web, so I wonder: will the same code written in React Native will work on the web, or it will require some additional modifications (if yes how complex are they)?


Solution

  • Not everything written for mobile in React-Native would work in web mode. It's not just because React Native Web is newer, but also because Web APIs are not equivalent to iOS/Android APIs - some features are simply not there for usage. Here is the compatibility list of React Native Web, in the official website.

    The lack of supports for both Web and mobile together also needs to be considered here. Take react-native-maps for example: it's written on top of Google Map SDKs for Android and iOS, and MapKit in iOS. It's entirely dependent on the mobile ecosystem, so if you want your map feature to work in Web, you have to implement separate solution for Web only.

    Overall, you need to know for each of your project requirements whether the related feature/library is supported in both web and mobile, and if there is not, do you have enough time and resource to implement the missing piece. If the answer is no, then you should separate your code base to handle web and mobile instead.