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

Starting the router is a side effect and must be wrapped in useEffect #607

Merged
merged 1 commit into from Feb 23, 2020

Conversation

wallzero
Copy link
Contributor

Since <UIRouter> was switched to a function component, uiRouter.current = needs to be wrapped in a useEffect. Otherwise multiple renders can trigger uiRouter.current.start().

The return must also check if uiRouter.current has been set and useState is used to force a rerender.

… for React.StrictMode and React.ConcurrentMode
@wallzero
Copy link
Contributor Author

Resolves #606

@christopherthielen christopherthielen merged commit 834c755 into ui-router:master Feb 23, 2020
@christopherthielen
Copy link
Member

thanks @wallzero 👍

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

Successfully merging this pull request may close these issues.

None yet

3 participants