Reputation: 5813
I want to create a React web app that may or may not become a native app, and for that I'd like to develop it using React Native for Web. However, I'm not sure what is the best course of action, to keep the native targets a realistic possibility:
react-native init
, then add the web aspects on top of it?create-react-native-app
and do the same?Upvotes: 4
Views: 3656
Reputation: 71
Another option is to use create-react-native-web-app https://www.npmjs.com/package/create-react-native-web-app
$ npm i -g create-react-native-web-app
$ create-react-native-web-app myApp
$ cd myApp
$ npm run web
Upvotes: 4
Reputation: 3092
I've been researching this process for the past week. Here are some options I found that might work for you.
There is the react-native-web
module which basically allows you to simply code in react-native with web polyfills.
Repo here: https://github.com/necolas/react-native-web
There's also a template called re-start
you can use which can set you up with a startpoint that will allow you to code in react-native and build Android, iOS, Web, Windows[UWP] and Electron[macOS, Ubuntu, Windows] apps.
Repo here: https://github.com/react-everywhere/re-start
If you don't want to use the polyfill option, I actually am working on a build that just simply merges react-native
and create-react-app
but you have to separate the logic between the 2 platforms yourself.
Repo here: https://github.com/ReyHaynes/react-redux-web-native
Upvotes: 3