johnkmzhou / cordova-create-react-app Goto Github PK
View Code? Open in Web Editor NEWA tutorial on how to set up a Cordova project using Create React App.
A tutorial on how to set up a Cordova project using Create React App.
Even on editing app.js, it doesn't reflects on device.
Hi!
Have any ideas how to use cordova plugins inside react?
For example simplest cordova-plugin-device
Trying call like:
But nothing works.
May I ask how can I live load the js on emulator with cordova?
I am trying to use your instructions in the README. I am still struggling with a sequel of error messages originating from the yarn run eject
step: missing babel-loader
, etc.
Question is: all cordova apps have their source code inside www/
, so I don't understand why you use that directory as build target. I fear that the build run will wipe it away every time, forcing me to move my source code elsewhere. But then why not leave the build target where create-react-app
puts it?
On the other hand, I do not see how to integrate the various cordova build <platform>
commands in the collection of scripts of the React app without ejecting it.
Can you please shed some more light on this subject?
I was following this tutorial and I faced an issue where cordova.js
wasn't loaded when index.js
was executed.
In particular, window.cordova
was undefined at this part. It would load later.
if (window.cordova) {
document.addEventListener('deviceready', startApp, false);
} else {
startApp();
}
I found the problem was that the <script type="text/javascript" src="cordova.js"></script>
was placed below the </body>
. This would lead to the script loading after the app. More information here.
To fix this, cordova.js
should be placed somewhere such as before </head>
(which is where the css is linked). This ensures we have cordova
when the app bootstraps. I tried this fix and it works for me.
i followed everything you mentioned, but at the end when i run cordova emulator androind
the emulator started but i only got empty white screen.
cordova version: 8.1.0
React version: 16.5.2
Hello, thanks for this amazing tutorial. It was helpful to me.
The only question is about ejection. When I ejected, the config folder was readonly, so I coudn't edit it. But it was not necessary, as the only reason to do that is to change the build path. I could manually move the build to www folder. Alternatively, you can do something as said in this issue, but with caution about support.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.