Skip to content

Commit

Permalink
docs: update "Current Future Flags"
Browse files Browse the repository at this point in the history
  • Loading branch information
brookslybrand committed Nov 18, 2024
1 parent dd323b6 commit 79241a8
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/upgrading/future.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,33 @@ createBrowserRouter(routes, {
});
```

**Update your Code**

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`.

👉 **Replace `fallbackElement` with `HydrateFallback`**

```diff
const router = createBrowserRouter(
[
{
path: "/",
Component: Layout,
+ HydrateFallback: Fallback,
// or
+ hydrateFallbackElement: <Fallback />,
children: [],
},
],
);


<RouterProvider
router={router}
- fallbackElement={<Fallback />}
/>
```

## v7_skipActionErrorRevalidation

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

0 comments on commit 79241a8

Please sign in to comment.