Closed giantelk closed 9 years ago
Same issue for me using Linux.
My guess is that inject-react.js is never actually used on the client. In package.js, this file is added only for "server" and never for client. I guess it works on web cause the initial page rendering is done on the server and thus React is properly loaded.
@giantelk any luck with this? I'm seeing the same problem with iOS.
I've made it to work on my local setup... Not tested with server-side rendering so I'm not sure if it's covers everything. So my modification are not ready for a pull-request.
Currently, the package tries to load the minified react when building for prod. It's done with a quick hack that generate a script tag. This will never work on Cordova. This hack is also not really useful because Meteor is going to minify all the javascript when building for production.
So my fix is to just add the unminified react-with-addons js to the client and export the React object.
I'll try to test and clean-up my fix to submit a pull-request, however I can't promise a time-frame.
Meanwhile, you can use this gist to apply my fix to a local copy of the package.
@ukabu thanks. That fixes the problem with React
not being defined, but now React.addons
is undefined
. Any ideas?
@idris That's weird, it seems to be properly defined for me, both on the client (web and cordova) and server. Do you have sample code?
Oops, sorry.. I had messed something else up. Looks like your code works! Thanks!
@idris I put my Meteor React stuff on hold for now, so no, haven't had chance to test this out again.
Using Mac OS X, I get the following errors running:
meteor run android
. I can run other Blaze meteorJS projects OK in the Android simulator, but not this react-meteor leaderboard example. See errors below, btw: I didmeteor update
to v1.1, and this ReactJS example works OK in Chrome browser.