You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
					
						
							4.1 KiB
						
					
					
				
			
		
		
	
	
							4.1 KiB
						
					
					
				react-router
6.6.1
Patch Changes
- Updated dependencies:
- @remix-run/router@1.2.1
 
6.6.0
Patch Changes
- Prevent useLoaderDatausage inerrorElement(#9735)
- Updated dependencies:
- @remix-run/router@1.2.0
 
6.5.0
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/:widget3
 
Optional Static Segment Example
- <Route path="/home?">will match:- /
- /home
 
- <Route path="/fr?/about">will match:- /about
- /fr/about
 
Minor Changes
- Allows optional routes and optional static segments (#9650)
Patch Changes
- Stop incorrectly matching on partial named parameters, i.e. <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)
// Old behavior at URL /prefix-123
<Route path="prefix-:id" element={<Comp /> }>
function Comp() {
  let params = useParams(); // { id: '123' }
  let id = params.id; // "123"
  ...
}
// New behavior at URL /prefix-123
<Route path=":id" element={<Comp /> }>
function Comp() {
  let params = useParams(); // { id: 'prefix-123' }
  let id = params.id.replace(/^prefix-/, ''); // "123"
  ...
}
- Updated dependencies:
- @remix-run/router@1.1.0
 
6.4.5
Patch Changes
- Updated dependencies:
- @remix-run/router@1.0.5
 
6.4.4
Patch Changes
- Updated dependencies:
- @remix-run/router@1.0.4
 
6.4.3
Patch Changes
- useRoutesshould be able to return- nullwhen passing- locationArg(#9485)
- fix initialEntriestype increateMemoryRouter(#9498)
- Updated dependencies:
- @remix-run/router@1.0.3
 
6.4.2
Patch Changes
- Fix IndexRouteObjectandNonIndexRouteObjecttypes to makehasErrorElementoptional (#9394)
- Enhance console error messages for invalid usage of data router hooks (#9311)
- If an index route has children, it will result in a runtime error. We have strengthened our RouteObject/RoutePropstypes to surface the error in TypeScript. (#9366)
- Updated dependencies:
- @remix-run/router@1.0.2
 
6.4.1
Patch Changes
- Preserve state from initialEntries(#9288)
- Updated dependencies:
- @remix-run/router@1.0.1
 
6.4.0
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.
New APIs
- Create your router with createMemoryRouter
- Render your router with <RouterProvider>
- Load data with a Route loaderand mutate with a Routeaction
- Handle errors with Route errorElement
- Defer non-critical data with deferandAwait
Bug Fixes
- Path resolution is now trailing slash agnostic (#8861)
- useLocationreturns the scoped location inside a- <Routes location>component (#9094)
Updated Dependencies
- @remix-run/router@1.0.0