React Router 11 ⚛️ Data Loaders — Fetching data with loaders
The previous chapters covered the navigation, the routes, and the path and query parameters. This chapter introduces the mechanism that fetches the data before the route renders: the loader. In the React Router, the loader is a function defined on the route object. It runs before the component renders, and its result is available to…