|
1
|
import { Spinner } from "@medusajs/icons" |
|
2
|
|
|
3
|
/** |
|
4
|
* Rendered by the root route while react-router resolves loaders on the initial |
|
5
|
* page load. |
|
6
|
* |
|
7
|
* Required from react-router 7 onwards: partial hydration is the default there |
|
8
|
* (it was the opt-in `v7_partialHydration` flag in v6), and a data router with |
|
9
|
* loaders but no `HydrateFallback` warns on every initial load. |
|
10
|
* |
|
11
|
* Deliberately identical to `ProtectedRoute`'s loading state, so the two phases |
|
12
|
* of startup look like one continuous spinner rather than two. |
|
13
|
*/ |
|
14
|
export const HydrateFallback = () => { |
|
15
|
return ( |
|
16
|
<div className="flex min-h-screen items-center justify-center"> |
|
17
|
<Spinner className="text-ui-fg-interactive animate-spin" /> |
|
18
|
</div> |
|
19
|
) |
|
20
|
} |