Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with react-router #43

Closed
rottmann opened this issue Dec 10, 2014 · 5 comments
Closed

Error with react-router #43

rottmann opened this issue Dec 10, 2014 · 5 comments

Comments

@rottmann
Copy link

Use react-router and got an error on update:

Cannot not apply hot update to app.js: Found duplicate displayName in createRouter.js: "Router". react-hot-loader uses displayName to distinguish between several components in one file.

var routes = (
    <Route handler={App}>
        <Route name="aaa" path="/aaa" handler={Aaa} />
        <Route name="bbb" handler={Bbb}>
            <DefaultRoute handler={Ccc} />
            <Route name="ccc" path="/bbb/ccc" handler={Ccc} />
            <Route name="ddd" path="/bbb/ddd/:id" handler={Ddd} />
        </Route>
    </Route>
);

Router.run(routes, function(Handler, state) {
    React.render(<Handler flux={flux} />, document.getElementById('app'));
});
@gaearon
Copy link
Owner

gaearon commented Dec 10, 2014

Um, that's weird. Does it help to only enable react-hot-loader for JSX (and not JS) files?

@gaearon
Copy link
Owner

gaearon commented Dec 10, 2014

It's more or less the same issue as #24. You can fix this by adjusting your regex to only enable hot loader for JSX files. If you always use JS extension, you can opt some specific modules out of hot reloading by using exclude in loader config.

@gaearon gaearon mentioned this issue Dec 12, 2014
4 tasks
@gaearon
Copy link
Owner

gaearon commented Dec 12, 2014

This should no longer be an issue as of 1.0.0-alpha.

@gaearon
Copy link
Owner

gaearon commented Dec 15, 2014

It's not an issue with 1.0, so closing. Official release coming later this week.

@gaearon gaearon closed this as completed Dec 15, 2014
@rottmann
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants