react-router-dom
Link
component (now also supports mailto:
urls) (#9994)react-router@6.8.1
@remix-run/router@1.3.2
<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) <Link to="https://neworigin.com/some/path"> {/* Document request */}
<Link to="//neworigin.com/some/path"> {/* Document request */}
<Link to="https://www.currentorigin.com/path"> {/* Client-side navigation */}
useSearchParams
(#9969)preventScrollReset
on <fetcher.Form>
(#9963)pagehide
instead of beforeunload
for <ScrollRestoration>
. This has better cross-browser support, specifically on Mobile Safari. (#9945)@remix-run/router@1.3.1
react-router@6.8.0
unstable_useBlocker
hook for blocking navigations within the app's location origin (#9709)unstable_usePrompt
hook for blocking navigations within the app's location origin (#9932)preventScrollReset
prop to <Form>
(#9886)useBeforeUnload
(#9709)@remix-run/router@1.3.0
react-router@6.7.0
useId
consistency during SSR (#9805)react-router@6.6.2
@remix-run/router@1.2.1
react-router@6.6.1
useBeforeUnload()
hook (#9664)unstable_
prefix from createStaticHandler
/createStaticRouter
/StaticRouterProvider
(#9738)Error
objects from StaticRouterProvider
(#9664)<Form method>
and useSubmit
method values (#9664)hydrationData
(#9664)<button formmethod>
form submission overriddes (#9664)@remix-run/router@1.2.0
react-router@6.6.0
react-router@6.5.0
@remix-run/router@1.1.0
@remix-run/router@1.0.5
react-router@6.4.5
NavLink
and descendant <Routes>
(#9589, #9647)ErrorResponse
instances when using built-in hydration (#9593)basename
in static data routers (#9591)@remix-run/router@1.0.4
react-router@6.4.4
createHashRouter
(#9409)index
routes with a path
in useResolvedPath
(#9486)relative=path
prop on NavLink
(#9453)NavLink
behavior for root urls (#9497)@remix-run/router@1.0.3
react-router@6.4.3
basename
in useFormAction
(#9352)RouteObject
/RouteProps
types to surface the error in TypeScript. (#9366)react-router@6.4.2
@remix-run/router@1.0.2
react-router@6.4.1
@remix-run/router@1.0.1
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
createMemoryRouter
/createBrowserRouter
/createHashRouter
<RouterProvider>
loader
and mutate with a Route action
errorElement
<Form>
componentuseFetcher()
defer
and Await
<ScrollRestoration>
New Features
<Link relative="path">
(#9160)Bug Fixes
useLocation
returns the scoped location inside a <Routes location>
component (#9094)<Link replace>
prop if it is defined (#8779)Updated Dependencies
react-router@6.4.0