-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Description
Using the latest react-router available on Bower (in the browser) / NPM (in the build process), I am doing the following (built using browserify using babelify using the latest babel-core@5.5.8):
// Import the app
import App from "./components/App";
import {Router, Route, Link} from "react-router";
import HashHistory from 'react-router/lib/HashHistory';
React.render(
<Router history={HashHistory}>
<Route path="channels/web_site/website_control_manager.php/channel/:channelId" component={App} />
</Router>,
document.getElementById("website-controls-container")
);
where components/App.js is:
export default React.createClass({
render() {
return (
<div>
{this.props.children}
</div>
);
}
});
I get the following error: Uncaught TypeError: Cannot read property '_currentElement' of null
which dies in React in ReactCompositeComponentMixin._updateRenderedComponent
at var prevRenderedElement = prevComponentInstance._currentElement;
.
One thing of note is that I am using the above import statements to import react-router
, which then imports react
as its own dependency. This means that Babel/Browserify are pulling those dependencies into the bundle, but I'm Bower to install react-router and react for use in the browser (I could not figure out how to use the libraries as pulled into the bundle by Babel/Browserify)... could that be the possible culprit? And if so what is the Right Way to do this kind of thing (using ES6 imports, but then running it in the browser).
Thank you for any assistance.