1.2 KiB
1.2 KiB
title, hidden
| title | hidden |
|---|---|
| Hydration | true |
There are a few nuances worth noting around the behavior of HydrateFallback:
- It is only relevant on initial document request and hydration, and will not be rendered on any subsequent client-side navigations
- It is only relevant when you are also setting [
clientLoader.hydrate=true][hydrate-true] on a given route - It is also relevant if you do have a
clientLoaderwithout a serverloader, as this impliesclientLoader.hydrate=truesince there is otherwise no loader data at all to return fromuseLoaderData- Even if you do not specify a
HydrateFallbackin this case, React Router will not render your route component and will bubble up to any ancestorHydrateFallbackcomponent - This is to ensure that
useLoaderDataremains "happy-path" - Without a server
loader,useLoaderDatawould returnundefinedin any rendered route components
- Even if you do not specify a
- You cannot render an
<Outlet/>in aHydrateFallbackbecause children routes can't be guaranteed to operate correctly since their ancestor loader data may not yet be available if they are runningclientLoaderfunctions on hydration (i.e., use cases such asuseRouteLoaderData()oruseMatches())