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

Async onEnter hook can lead to inconsistent state #3476

Closed
hoschi opened this issue May 18, 2016 · 1 comment
Closed

Async onEnter hook can lead to inconsistent state #3476

hoschi opened this issue May 18, 2016 · 1 comment
Labels

Comments

@hoschi
Copy link

hoschi commented May 18, 2016

Version

2.4.0

Test Case

http://codepen.io/hoschi/pen/wGbZWo?editors=0010

Steps to reproduce

  • click on "Users" link, shows still "Home"
  • click on "Widgets" link, shows Widgets component
  • wait

Expected Behavior

  • Widgets component stays visible
  • url is still "/widgets"

Actual Behavior

  • Users component shows up
  • url is still "/widgets", which doesn't match the component on the screen

Description

The example has an onEnter hook which calls the callback after two seconds. When you move away from the "Users" route to "Widgets" all works fine. After the delay finishes you get an inconsistent state, as described above.

I think the problem lies in async management of hooks, where waiting callbacks should be dismissed on a location change.

@alisd23
Copy link
Contributor

alisd23 commented Oct 27, 2016

Should be fixed in #4063

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

No branches or pull requests

4 participants