Skip to content

Commit 79241a8

Browse files
committed
docs: update "Current Future Flags"
1 parent dd323b6 commit 79241a8

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/upgrading/future.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,33 @@ createBrowserRouter(routes, {
200200
});
201201
```
202202

203+
**Update your Code**
204+
205+
With partial hydration, you need to provide a `HydrateFallback` component to render during initial hydration. Additionally, if you were using `fallbackElement` before, you need to remove it as it is now deprecated. In most cases, you will want to reuse the `fallbackElement` as the `HydrateFallback`.
206+
207+
👉 **Replace `fallbackElement` with `HydrateFallback`**
208+
209+
```diff
210+
const router = createBrowserRouter(
211+
[
212+
{
213+
path: "/",
214+
Component: Layout,
215+
+ HydrateFallback: Fallback,
216+
// or
217+
+ hydrateFallbackElement: <Fallback />,
218+
children: [],
219+
},
220+
],
221+
);
222+
223+
224+
<RouterProvider
225+
router={router}
226+
- fallbackElement={<Fallback />}
227+
/>
228+
```
229+
203230
## v7_skipActionErrorRevalidation
204231

205232
<docs-warning>If you are not using a `createBrowserRouter` you can skip this</docs-warning>

0 commit comments

Comments
 (0)