Update react-router monorepo to v6 (major) #153
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^3.0.0 || ^4.0.0 || ^5.0.0->^6.0.0^5.0.0->^6.0.0^5.0.0->^6.0.0^3.0.0->^6.0.0Release Notes
remix-run/react-router (react-router)
v6.9.0Compare Source
Minor Changes
React Router now supports an alternative way to define your route
elementanderrorElementfields as React Components instead of React Elements. You can instead pass a React Component to the newComponentandErrorBoundaryfields if you choose. There is no functional difference between the two, so use whichever approach you prefer 😀. You shouldn't be defining both, but if you doComponent/ErrorBoundarywill "win". (#10045)Example JSON Syntax
Example JSX Syntax
Introducing Lazy Route Modules! (#10045)
In order to keep your application bundles small and support code-splitting of your routes, we've introduced a new
lazy()route property. This is an async function that resolves the non-route-matching portions of your route definition (loader,action,element/Component,errorElement/ErrorBoundary,shouldRevalidate,handle).Lazy routes are resolved on initial load and during the
loadingorsubmittingphase of a navigation or fetcher call. You cannot lazily define route-matching properties (path,index,children) since we only execute your lazy route functions after we've matched known routes.Your
lazyfunctions will typically return the result of a dynamic import.Then in your lazy route modules, export the properties you want defined for the route:
An example of this in action can be found in the
examples/lazy-loading-router-providerdirectory of the repository.🙌 Huge thanks to @rossipedia for the Initial Proposal and POC Implementation.
Updated dependencies:
@remix-run/router@1.4.0Patch Changes
generatePathincorrectly applying parameters in some cases (#10078)v6.8.2Compare Source
Patch Changes
@remix-run/router@1.3.3v6.8.1Compare Source
Patch Changes
@remix-run/router@1.3.2v6.8.0Compare Source
Patch Changes
@remix-run/router@1.3.1v6.7.0Compare Source
Minor Changes
unstable_useBlockerhook for blocking navigations within the app's location origin (#9709)Patch Changes
generatePathwhen optional params are present (#9764)<Await>to acceptReactNodeas children function return result (#9896)@remix-run/router@1.3.0v6.6.2Compare Source
Patch Changes
useIdconsistency during SSR (#9805)v6.6.1Compare Source
Patch Changes
@remix-run/router@1.2.1v6.6.0Compare Source
Patch Changes
useLoaderDatausage inerrorElement(#9735)@remix-run/router@1.2.0v6.5.0Compare Source
This release introduces support for Optional Route Segments. Now, adding a
?to the end of any path segment will make that entire segment optional. This works for both static segments and dynamic parameters.Optional Params Examples
<Route path=":lang?/about>will match:/:lang/about/about<Route path="/multistep/:widget1?/widget2?/widget3?">will match:/multistep/multistep/:widget1/multistep/:widget1/:widget2/multistep/:widget1/:widget2/:widget3Optional Static Segment Example
<Route path="/home?">will match://home<Route path="/fr?/about">will match:/about/fr/aboutMinor Changes
Patch Changes
<Route path="prefix-:param">, to align with how splat parameters work. If you were previously relying on this behavior then it's recommended to extract the static portion of the path at theuseParamscall site: (#9506)@remix-run/router@1.1.0v6.4.5Compare Source
Patch Changes
@remix-run/router@1.0.5v6.4.4Compare Source
Patch Changes
@remix-run/router@1.0.4v6.4.3Compare Source
Patch Changes
useRoutesshould be able to returnnullwhen passinglocationArg(#9485)initialEntriestype increateMemoryRouter(#9498)@remix-run/router@1.0.3v6.4.2Compare Source
Patch Changes
IndexRouteObjectandNonIndexRouteObjecttypes to makehasErrorElementoptional (#9394)RouteObject/RoutePropstypes to surface the error in TypeScript. (#9366)@remix-run/router@1.0.2v6.4.1Compare Source
Patch Changes
initialEntries(#9288)@remix-run/router@1.0.1v6.4.0Compare Source
Whoa this is a big one!
6.4.0brings 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.New APIs
createMemoryRouter<RouterProvider>loaderand mutate with a RouteactionerrorElementdeferandAwaitBug Fixes
useLocationreturns the scoped location inside a<Routes location>component (#9094)Updated Dependencies
@remix-run/router@1.0.0v6.3.0: react-router@v6.3.0Compare Source
What's Changed
New Contributors
Full Changelog: remix-run/react-router@v6.2.2...v6.3.0
v6.2.2Compare Source
What's Changed
🐛 Bug Fixes
New Contributors
Full Changelog: remix-run/react-router@v6.2.1...v6.2.2
v6.2.1Compare Source
This release updates the internal
historydependency to5.2.0.Full Changelog: remix-run/react-router@v6.2.0...v6.2.1
v6.2.0Compare Source
🐛 Bug fixes
RoutePropselementtype, which should be aReactNode(#8473)useOutletfor top-level routes (#8483)✨ Features
New Contributors
Full Changelog: remix-run/react-router@v6.1.1...v6.2.0
v6.1.1Compare Source
In v6.1.0 we inadvertently shipped a new, undocumented API that will likely introduce bugs (#7586). We have flagged
HistoryRouterasunstable_HistoryRouter, as this API will likely need to change before a new major release.Full Changelog: remix-run/react-router@v6.1.0...v6.1.1
v6.1.0Compare Source
🐛 Bug fixes
✨ Features
<Outlet>can now receive acontextprop. This value is passed to child routes and is accessible via the newuseOutletContexthook. See the API docs for details. (#8461)<NavLink>can now receive a child function for access to its props. (#8164)💅 Enhancements
useMatchandmatchPath. For example, when you calluseMatch("foo/:bar/:baz"), the path is parsed and the return type will bePathMatch<"bar" | "baz">. (#8030)New Contributors
Full Changelog: remix-run/react-router@v6.0.1...v6.1.0
v6.0.2Compare Source
✨ Features
reloadDocumentprop to<Link>. This allows<Link>to function like a normal anchor tag by reloading the document after navigation while maintaining the relativetoresolution.🗒️ Docs
🤝 New Contributors
Full Changelog
v6.0.1Compare Source
🐛 Bug Fixes
<StaticRouter location>value (#8243)<Route>inside<Routes>to help people make the change (#8238)v6.0.0Compare Source
React Router v6 is here!
Please go read our blog post for more information on all the great stuff in v6 including notes about how to upgrade from React Router v5 and Reach Router.
remix-run/react-router (react-router-dom)
v6.9.0Compare Source
Minor Changes
React Router now supports an alternative way to define your route
elementanderrorElementfields as React Components instead of React Elements. You can instead pass a React Component to the newComponentandErrorBoundaryfields if you choose. There is no functional difference between the two, so use whichever approach you prefer 😀. You shouldn't be defining both, but if you doComponent/ErrorBoundarywill "win". (#10045)Example JSON Syntax
Example JSX Syntax
Introducing Lazy Route Modules! (#10045)
In order to keep your application bundles small and support code-splitting of your routes, we've introduced a new
lazy()route property. This is an async function that resolves the non-route-matching portions of your route definition (loader,action,element/Component,errorElement/ErrorBoundary,shouldRevalidate,handle).Lazy routes are resolved on initial load and during the
loadingorsubmittingphase of a navigation or fetcher call. You cannot lazily define route-matching properties (path,index,children) since we only execute your lazy route functions after we've matched known routes.Your
lazyfunctions will typically return the result of a dynamic import.Then in your lazy route modules, export the properties you want defined for the route:
An example of this in action can be found in the
examples/lazy-loading-router-providerdirectory of the repository.🙌 Huge thanks to @rossipedia for the Initial Proposal and POC Implementation.
Updated dependencies:
react-router@6.9.0@remix-run/router@1.4.0v6.8.2Compare Source
Patch Changes
<Link to>as external if they are outside of the routerbasename(#10135)useBlockerto returnIDLE_BLOCKERduring SSR (#10046)<Link to>urls (#10112)StaticRouterProviderserialized hydration data (#10068)@remix-run/router@1.3.3react-router@6.8.2v6.8.1Compare Source
Patch Changes
Linkcomponent (now also supportsmailto:urls) (#9994)react-router@6.8.1@remix-run/router@1.3.2v6.8.0Compare Source
Minor Changes
Support absolute URLs in
<Link to>. If the URL is for the current origin, it will still do a client-side navigation. If the URL is for a different origin then it will do a fresh document request for the new origin. (#9900)Patch Changes
useSearchParams(#9969)preventScrollReseton<fetcher.Form>(#9963)pagehideinstead ofbeforeunloadfor<ScrollRestoration>. This has better cross-browser support, specifically on Mobile Safari. (#9945)@remix-run/router@1.3.1react-router@6.8.0v6.7.0Compare Source
Minor Changes
unstable_useBlockerhook for blocking navigations within the app's location origin (#9709)unstable_usePrompthook for blocking navigations within the app's location origin (#9932)preventScrollResetprop to<Form>(#9886)Patch Changes
useBeforeUnload(#9709)@remix-run/router@1.3.0react-router@6.7.0v6.6.2Compare Source
Patch Changes
useIdconsistency during SSR (#9805)react-router@6.6.2v6.6.1Compare Source
Patch Changes
@remix-run/router@1.2.1react-router@6.6.1v6.6.0Compare Source
Minor Changes
useBeforeUnload()hook (#9664)unstable_prefix fromcreateStaticHandler/createStaticRouter/StaticRouterProvider(#9738)Patch Changes
Errorobjects fromStaticRouterProvider(#9664)<Form method>anduseSubmitmethod values (#9664)hydrationData(#9664)<button formmethod>form submission overriddes (#9664)@remix-run/router@1.2.0react-router@6.6.0v6.5.0Compare Source
Patch Changes
react-router@6.5.0@remix-run/router@1.1.0v6.4.5Compare Source
Patch Changes
@remix-run/router@1.0.5react-router@6.4.5v6.4.4Compare Source
Patch Changes
NavLinkand descendant<Routes>(#9589, #9647)ErrorResponseinstances when using built-in hydration (#9593)basenamein static data routers (#9591)@remix-run/router@1.0.4react-router@6.4.4v6.4.3Compare Source
Patch Changes
createHashRouter(#9409)indexroutes with apathinuseResolvedPath(#9486)relative=pathprop onNavLink(#9453)NavLinkbehavior for root urls (#9497)@remix-run/router@1.0.3react-router@6.4.3v6.4.2Compare Source
Patch Changes
basenameinuseFormAction(#9352)RouteObject/RoutePropstypes to surface the error in TypeScript. (#9366)react-router@6.4.2@remix-run/router@1.0.2v6.4.1Compare Source
Patch Changes
react-router@6.4.1@remix-run/router@1.0.1v6.4.0Compare Source
Whoa this is a big one!
6.4.0brings 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.New APIs
createMemoryRouter/createBrowserRouter/createHashRouter<RouterProvider>loaderand mutate with a RouteactionerrorElement<Form>componentuseFetcher()deferandAwait<ScrollRestoration>New Features
<Link relative="path">(#9160)Bug Fixes
useLocationreturns the scoped location inside a<Routes location>component (#9094)<Link replace>prop if it is defined (#8779)Updated Dependencies
react-router@6.4.0v6.3.0: react-router@v6.3.0Compare Source
What's Changed
New Contributors
Full Changelog: remix-run/react-router@v6.2.2...v6.3.0
v6.2.2Compare Source
What's Changed
🐛 Bug Fixes
New Contributors
Full Changelog: remix-run/react-router@v6.2.1...v6.2.2
v6.2.1Compare Source
This release updates the internal
historydependency to5.2.0.Full Changelog: remix-run/react-router@v6.2.0...v6.2.1
v6.2.0Compare Source
🐛 Bug fixes
RoutePropselementtype, which should be aReactNode(#8473)useOutletfor top-level routes (#8483)✨ Features
New Contributors
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Mend Renovate. View repository job log here.