react-router-dom
Advanced tools
Changelog
v6.16.0
Date: 2023-09-13
any
with unknown
on exposed typings for user-provided data. To do this in Remix v2 without introducing breaking changes in React Router v6, we have added generics to a number of shared types. These continue to default to any
in React Router and are overridden with unknown
in Remix. In React Router v7 we plan to move these to unknown
as a breaking change. (#10843)
Location
now accepts a generic for the location.state
valueActionFunctionArgs
/ActionFunction
/LoaderFunctionArgs
/LoaderFunction
now accept a generic for the context
parameter (only used in SSR usages via createStaticHandler
)useMatches
(now exported as UIMatch
) accepts generics for match.data
and match.handle
- both of which were already set to unknown
@private
class export ErrorResponse
to an UNSAFE_ErrorResponseImpl
export since it is an implementation detail and there should be no construction of ErrorResponse
instances in userland. This frees us up to export a type ErrorResponse
which correlates to an instance of the class via InstanceType
. Userland code should only ever be using ErrorResponse
as a type and should be type-narrowing via isRouteErrorResponse
. (#10811)ShouldRevalidateFunctionArgs
interface (#10797)_isFetchActionRedirect
, _hasFetcherDoneAnything
) (#10715)query
/queryRoute
calls (#10793)route.lazy
routes (#10778)actionResult
on the arguments object passed to shouldRevalidate
(#10779)Full Changelog: v6.15.0...v6.16.0
Changelog
v6.15.0
Date: 2023-08-10
redirectDocument()
function which allows users to specify that a redirect from a loader
/action
should trigger a document reload (via window.location
) instead of attempting to navigate to the redirected location via React Router (#10705)useRevalidator
is referentially stable across re-renders if revalidations are not actively occurring (#10707)URLSearchParams
and the useSearchParams
hook (#10620)unstable_usePrompt
to avoid throwing an exception if the prompt is unblocked and a navigation is performed synchronously (#10687, #10718)useFormAction()
for unspecified actions since it cannot be determined on the server and causes hydration issues (#10758)queryRoute
that was not always identifying thrown Response
instances (#10717)react-router-native
: Update @ungap/url-search-params
dependency from ^0.1.4
to ^0.2.2
(#10590)Full Changelog: v6.14.2...v6.15.0