State Management · Middle · Question 44 of 75
How does a component read the data returned by its route loader?
- ✓Correct answer: With
useLoaderData()(or theloaderDataprop in framework mode) - 2With
useStateinitialized fromwindow.loaderResult - 3With
useEffectthat calls the loader again
Explanation
The router runs the loader before rendering the route and passes the result in. With type generation in framework mode, loaderData is fully typed.