React Router will allow you to define loaders on each route, which will be called when the route is visited. In the route component itself, you can use loaderData() to get access to that data. If you navigate to contacts/1, data for that contact will be fetched before the component is rendered. This is awesome as it not only

12m read timeFrom tkdodo.eu
Post cover image
Table of contents
A router that fetches dataQuerifying the exampleInvalidating in actionsSummary
4 Comments

Sort: