Closed alfonsogrondo closed 8 years ago
Interestingly if I call the createBootstrapper
function this way: ReactHabitat.default.createBootstrapper({..});
then all is well with the world!?
Ahh yes it seems Babel 6 which (we are using) doesn't export the default module.exports
anymore. https://github.com/babel/babel/issues/2212
So the correct way to import our module in ES5 would be :
var ReactHabitat = require('react-habitat').default;
So you were close :)
We will need to update the docs to show this or.. look at implementing a babel plugin to set the exports
(which I'm leaning to).
In the mean time please use the above code which is a perfectly valid pattern.
Thanks for opening the issue. Jenna
Thants @jennasalau, I've updated the module import to above and works fine.
Re-opening because we will address this in the next release.
This is now resolved.. As of v0.3.0 please use var ReactHabitat = require('react-habitat');
as per the docs.
I'm new to React and feel I'm missing something fundamental here. This is my root 'App.js' code:
react-habitat is definitely installed and I'm using Browserify to manage the packages I need for the app.
I get 'ReactHabitat.createBootstrapper is not a function' in the console after firing up the server.
Any ideas?
Thanks