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

[v0.13.3] HistoryLocation no longer fires run callback #1833

Closed
ericclemmons opened this issue Sep 6, 2015 · 1 comment
Closed

[v0.13.3] HistoryLocation no longer fires run callback #1833

ericclemmons opened this issue Sep 6, 2015 · 1 comment

Comments

@ericclemmons
Copy link

First, I apologize if this issue is covered elsewhere, but my searching didn't turn up either a solution.

The issue was first discovered in ericclemmons/react-resolver#75 & ericclemmons/react-resolver#78.

Given:

export default (
  <Route handler={App}>
    // Query-able URLs (for POSTs & crawlers)
    <Route name="query.repo" path="/repo" handler={Stargazers} />

    // Canonical URLs
    <Route name="home" path="/" handler={Home} />
    <Route name="user" path="/:user" handler={Stargazer} />
    <Route name="repo" path="/:user/:repo" handler={Stargazers} />

    <NotFoundRoute name="404" handler={NotFound} />
  </Route>
);

and the usual:

Router.run(routes, Router.HistoryLocation, (Root) => {
  console.log("Routed!"); // This is here to confirm routing has taken place!
  Resolver.render(() => <Root />, document.getElementById("app"));
});

You can see routing stops working after the history changes the first time:

router

However, React Router v1.0.0-beta3 works as expected:

14

In my testing, HashLocation works correctly.

Is this a not-so-obvious error on my part, or something that will need a more time-intensive test-case to reason about? 😜

@ericclemmons
Copy link
Author

After digging into the issue like crazy, the best I can assume is that context or something goes haywire.

That's the best I've got. Anyway, released React Resolver v2.0.5 with a fix that just neuters some functionality since it's a common edge-case:

https:/ericclemmons/react-resolver/blob/master/CHANGELOG.md#v205---2015-09-07

@lock lock bot locked as resolved and limited conversation to collaborators Jan 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant