最終更新:2024-12-09 (月) 17:16:03 (40d)
React Router v6.4.0
Top / React Router v6.4.0
2022-09-13
https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v640
What's Changed
Remix Data APIs
- Whoa this is a big one! 6.4.0 brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the docs, especially the feature overview and the tutorial.
- React Router/データAPI?
New react-router APIs
- Create your router with createMemoryRouter?
- Render your router with RouterProvider
- Load data with a Route loader and mutate with a Route action
- Handle errors with Route errorElement
- Defer non-critical data with defer and Await
New react-router-dom APIs
- Create your router with createBrowserRouter/createHashRouter
- Submit data with the new <Form> component
- Perform in-page data loads and mutations with useFetcher?()
- Defer non-critical data with defer and Await
- Manage scroll position with ScrollRestoration?
- Perform path-relative navigations with <Link relative="path"> (#9160)
In v6.4, new routers were introduced that support the new data APIs:
- https://reactrouter.com/6.28.0/routers/picking-a-router
- createBrowserRouter
- createMemoryRouter?
- createHashRouter
- createStaticRouter?