the routes can have an
loader
prop, a function that receives the routes params and can return a promise. This promise can be consumed in the Routes component with a
useLoader
prop.
There is also a way to rerun the
loader
.
A
loadingComponent
prop implements the loading state.
Bonus:
throwing special errors in the
loader
, for example
redirect('..', { withAnimation: boolean })