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

Routes break after clicking first link #75

Closed
jachenry opened this issue Aug 27, 2015 · 7 comments
Closed

Routes break after clicking first link #75

jachenry opened this issue Aug 27, 2015 · 7 comments
Labels
Milestone

Comments

@jachenry
Copy link

I have an issue where the client side routes break after navigating to a single link. From then on the path changes in the address bar but nothing gets updated on the screen. All the Handlers are returning standard React components without wrapping with Resolvers.

package.json

    "react": "0.13.3",
    "react-router": "0.13.3",
    "react-resolver": "^2.0.4",
    "react-router-server-location": "^2.0.0",

Routes.js

    <Route path="/" handler={Main}>
        <DefaultRoute handler={Home} />
        <Route name="signin" path="/signin" handler={Signin}/>
        <Route name="signup" path="/signup" handler={Signup}/>
        <Route name="forgot_password" path="/users/password" handler={ForgotPassword}/>
        <Route name="reset_password" path="/users/password/edit" handler={ResetPassword}/>
        <Route name="account" path="/account/profile" handler={AccountNavigation}>
            <DefaultRoute name="account_profile" handler={AccountProfile} />
            <Route name="account_settings" path="/account/settings" handler={AccountSettings} />
        </Route>
    </Route>

client.js

Router.run(routes, Router.HistoryLocation, (Root) => {
    Resolver.render(() => <Root />, document.getElementById("react-root"));
});
@ericclemmons
Copy link
Owner

Thanks for the detailed report!

I think I'll have to create a "plain" example as you've described with no @resolve decorators to replicate this.

Which means, there's also no need for you to do Resolver.render then, since there's nothing to resolve. React.render(<Root />) will suffice.

Are there any errors in your console at all?

@ericclemmons ericclemmons added this to the v2 milestone Aug 27, 2015
@jachenry
Copy link
Author

Switching to React.render(...) solved the issue.

Router.run(routes, Router.HistoryLocation, (Root) => {
    React.render(<Root />, document.getElementById("react-root"))
    //Resolver.render(() => <Root />, document.getElementById("react-root"));
});

@ericclemmons
Copy link
Owner

@jachenry Let me know if everything goes back to normal once you start decorating components.

I'm re-opening because this is an edge-case that I still find peculiar...

@ericclemmons ericclemmons reopened this Aug 27, 2015
@ericclemmons
Copy link
Owner

Actually, this looks related to #78.

It's a regression. Thanks for letting me know!

@benbonnet
Copy link

Where is the regression happening ? Was stuck too.

Without the Resolver.render as jack henry did, the page loads, then the data appears after being fetched… but you still have server side rendering °_° ! How come ?

@ericclemmons
Copy link
Owner

I'll be working on this stuff today.

@ericclemmons
Copy link
Owner

To be honest, I can't figure out how this is an issue with the Resolver & can only confirm it's an issue with React Router v0.13.3:

router

It's not a problem with React Router v1.0.0-beta3:

14

I just opened remix-run/react-router#1833 for help on this & will re-open this issue as needed...

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

No branches or pull requests

3 participants