Closed YChebotaev closed 8 years ago
I've used this lib with browserify and browserify-shim. It sounds like you have two versions of react in the browser. Maybe check your bundle?
In my root's package.json, I had:
"browserify-shim": {
"react": "global:React",
"react/addons": "global:React",
}
Also, since material-ui will be in _nodemodules, you'll need to specify browserify-shim as a global transform:
b = require('browserify')();
b.transform(require('browserify-shim'), {global: true});
I have edit my config as following:
"browserify-shim": {
"react": "global:React",
"react/addons": "global:React"
},
"browserify": {
"transform": [
["babelify", {"stage": 0}],
"reactify",
["browserify-shim", {"global": true}]
]
}
And this is not working: i'm have entire react bundled with my app.
ReactWithAddon.js
in your browser.{"global": true}
for shim only works with programming API. (http://github.com/thlorenz/browserify-shim/issues/191)@YChebotaev were you able to get this to work? Trying to see if I can close this issue.
react is now a peer dependency.
I want to replace a default material-ui's react dependencty to a prebuild by facebook version of minified react.
I have following error:
Uncaught TypeError: Cannot read property 'component' of undefined
in function in a Paper class:this.context.muiTheme
variable inside this function isundefined
.It breaks only when i'm trying to use different react build.
I use browserify as module bundler and at first i was try a following config in package.json:
I'm also trying to use browserify-shim without success.