-
Notifications
You must be signed in to change notification settings - Fork 50.9k
Description
I am building frontend with browserify (+ reactify), and I found out, that when some of my components use var React = require('react'); and others use var React = require('react/addons'); then it seems like that each set of components has a different instance of React that don't talk to each other.
This means that if I instantiate my app with
var React = require('react'); // no addons
var App = require('./components/App.jsx');
React.render(<App />, document.body);
while my components use var React = require('react/addons'); // with addons, then it seems that any events fired by such components aren't handled (for example onClick={this.onClick} isn't called) - seemingly because their instance of React is different one than the instance that rendered the root.
When I replaced all require('react') calls in my app with require('./oneReact.js') where oneReact.js looks like this:
var React = require('react/addons');
module.exports = React;
all events started being handled again.
Is this behavior a bug or by design?