Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Explain the difference between rerouteTo and forwardTo #1355

Open
mvysny opened this issue Sep 23, 2020 · 2 comments
Open

Explain the difference between rerouteTo and forwardTo #1355

mvysny opened this issue Sep 23, 2020 · 2 comments

Comments

@mvysny
Copy link
Member

mvysny commented Sep 23, 2020

The https://vaadin.com/docs/v14/flow/routing/tutorial-routing-lifecycle.html#rerouting docs doesn't help: the docs for forward and rerouteTo are almost identical.

The BeforeEnterEvent's javadoc doesn't explain the difference at all also:

  • rerouteTo(): Reroutes the navigation to show the given component instead of the component that is currently about to be displayed.
  • forwardTo(): Forward the navigation to show the given component instead of the component that is currently about to be displayed.

The same thing, just 'forward' instead of 'reroutes'.

Update the documentation to mention the difference between the two.

@mvysny
Copy link
Member Author

mvysny commented Sep 23, 2020

Just guessing: could it be that rerouteTo updates the browser's URL while forwardTo does not?

@mvysny
Copy link
Member Author

mvysny commented Sep 23, 2020

Yes:

  • rerouteTo() doesn't change the browser's URL
  • forwardTo() also changes the browser's URL

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