2

Can someone help me in setting up configuration to build a Mobile app using reactjs and Cordova. I tried using pasting my react js app to www in Cordova and changing some configuration. But getting white screen. Can someone help me in setting up or some steps need to be followed to get it running.

Akshay Bora
  • 101
  • 8

1 Answers1

0

Can you provide more details as to what setup you are using for development and build? Ideally, there should be a command to build, which will generate a bundle.js or a main.js or something similar.

You can then move this file to the www directory in cordova and link to it from www/index.html to get things working.

Umang Galaiya
  • 534
  • 5
  • 11
  • For creating Cordova app i am using "Cordova create appname" and for reactjs app i am using "create-react-app my-app" after adding platform to the Cordova project, i am using Cordova build android and then Cordova run android. – Akshay Bora Jul 16 '17 at 03:55
  • Use `npm run build` or `yarn build` - See documentation https://github.com/facebookincubator/create-react-app#npm-run-build-or-yarn-build – Umang Galaiya Jul 16 '17 at 09:17
  • How can I link Cordova and react. Only react web app i am able to run properly and getting it in chrome. – Akshay Bora Jul 16 '17 at 09:34
  • You are most probably running the react app from a local web server. You need to execute `npm run build` or `yarn build` - which will generate a `.js` file that you can link from the `index.html` in `www` – Umang Galaiya Jul 17 '17 at 09:51