Search code examples
react-nativereact-native-web

React Native web - several questions


I understand that there is a browser version for react native - react-native-web

  1. Is it responsive like bootstrap? For example, in bootstrap we can have on desktop 3 columns one beside the other. Same code can produce that the columns will be one under the other on mobile. Is it built in react native or that we need to use bootstrap any case?

  2. Back button. If I go to my react native web version on mobile, and hit the back button. Will it act like an app, or go to previous page like a regular web page?

  3. If I want my web code to act like an app, does it mean to code the same thing again, or can I use the code as it is and it will work as an app in the play store?

  4. Does react native web looks better than bootstrap (buttons etc)

  5. Does it support all functions exactly like react native?


Solution

    1. react-native-web just provides a compatibility level that allows you to run your react-native apps in the browser. It's more like a set of polyfills and implementations of some RN components. How your app will work and what it will do is complemety on you. RNW is not a UI framework or components library like bootstrap, instead it's just primitives.

    2. Navigation isn't something that react-native-web provides you out of the box. As I said, it's just a set of primitive components. You will need to choose some library like react-navigation that runs on both react-native and web, or use different solutions for diffent platforms.

    3. Code sharing is a great thing of react-native. As long as you write simple JavaScript modules and not use native APIs, you can share them across web and native.

    4. See the first question.

    5. It provides you the same set of components, gesture system, StyleSheet and some other utilities like Platform. Visually components can differ from their RN implementations, but their API and behaviour is the same.