Skip to content

1.0.0@beta1: Cannot read property '_currentElement' of null #1329

@bwhitty

Description

@bwhitty

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions