create-react-native-web-app | React Native Web CLI | Frontend Framework library
kandi X-RAY | create-react-native-web-app Summary
kandi X-RAY | create-react-native-web-app Summary
React Native Web CLI
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Run Yarn package .
create-react-native-web-app Key Features
create-react-native-web-app Examples and Code Snippets
Community Discussions
Trending Discussions on create-react-native-web-app
QUESTION
I'm trying to create a react-native-for-web app to build for iOS and web platforms. A solution to my question will get the xcode/mac Simulator running with hot reloading of the iOS version, while also running the web version, of a "react-native-web": "^0.9.x" app.
I googled how to start one of these, and found the top few articles were written by the creator of create-react-native-web-app, so I decided to try this method. It has however been an uphill battle.
But first of all, the part that seems to work out of the box is the web part. In my first attempt, after running npx create-react-native-web-app demo-app
, yarn web
immediately worked. :)
But yarn iOS wouldn't build, and there were multiple issues.
I have node -v >> v11.5.0
. I'm on Mohave, with xcode 10.1 already setup (for iOS development).
- I needed to install the xcode 10.1 commandline tools though.
- Then, I needed to
yarn iOS
- followed by opening the
creaternwapp
project underios/
and change the Project Settings > Build System to Legacy Build System. - Then I had to attempt to build it in xcode. (turns out this is important, even though build will fail)
- Then,
(cd node_modules/react-native/third-party/glog-0.3.4/ && ./configure)
// those numbers may change apparently, depending on install whether I needed to or not, I changed the
....babelrc
from:
ANSWER
Answered 2019-Jan-25 at 02:07This is not the answer I was looking for, I would love create-react-native-web-app to work out of the box .. but for now -- here's how I am using rn + rnw , even with react-native-paper:
I can describe how to get react-native-paper working in expo.
expo init --yarn --template blank demo-app
-- cd demo-app
yarn add react-native-web react-router-dom react-router-native react-app-polyfill react-art react-native-paper react-dom
-- yarn add -D react-scripts @babel/preset-flow @babel/plugin-proposal-class-properties
code package.json
and add scripts:"web": "react-scripts start", "build-web": "react-scripts build"
-- we're going to be cheating and editing them in-place. A better practice is to copy node-modules/react-scripts/ config and scripts into your project folder, install their dependencies and get them working locally. But this is just a proof-of-concept (so .. just be sure not to reinstall node_modules or react-scripts for now on)
-- configure/add main:
"main": "react-native-main.js",
code react-native-main.js
saving:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install create-react-native-web-app
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page