Skip to content
Plague Fox edited this page Jan 9, 2024 · 1 revision

Guards are a powerful tool for controlling navigation. They allow you to check the state of the router and mutate/cancel navigation if necessary. For example, you can check the user's authorization and redirect them to the login page if they are not authorized.

Examples:

  1. How to make an authentification guard and restore the previous state after login
  2. How to place a Home route at the root of the navigation stack
Clone this wiki locally