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

fix(confirmLeave): update current route's history blocking after "addRoutes" #359

Merged

Conversation

artkravchenko
Copy link
Contributor

@artkravchenko artkravchenko commented Jun 16, 2019

Hey!

This PR introduces support of usage scenarios when initial route is needed to be location-blocking and loaded partially (without confirmLeave property) on init but it's updated (adding confirmLeave) using addRoutes() later. It's necessary if the following conditions are combined:

  • router related code-splitting is used;
  • SSR is used;
  • only serializable parts of current route's config are sent from the server (such as path property);
  • full implementation of the routes is loaded and applied with subsequent JavaScript chunks;
  • current route must block the navigation (confirmLeave() is present on route's full config).

We use this technique at fish.travel right now.

Also, @oopscurity/redux-first-router@2.1.2 includes these changes applied on the original repo's master branch.

@ScriptedAlchemy
Copy link
Collaborator

Reviewing today, appreciate the PR!

@artkravchenko
Copy link
Contributor Author

@ScriptedAlchemy, absolutely! Let me know how I can improve the PR.

@ScriptedAlchemy ScriptedAlchemy merged commit a8f3bb3 into faceyspacey:master Jul 29, 2019
@faceyspacey
Copy link
Owner

🎉 This PR is included in version 2.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

3 participants