Skip to content

Upgrading react-router-dom 6 to 7

Unknown6.30.6 → 7.18.5

UnknownUpgrade verdict

68 of 121 releases publish no notes, so breaking changes can't be ruled out.

  • Some releases in this range publish no notes, so DepDelta can't rule out breaking changes.
  • DepDelta found no commit log for them either.
Unknown for releases without notes

Releases without notes may still need changes. Check their commits before upgrading.

Node.js requirement changed in 7.0.0-pre.2: >=14.0.0 → >=20.0.0.

Drops @remix-run/router.

Installs 3 packages in all (was 2).

Generated by DepDelta from published .d.ts files. Not mixed with prose notes.

  • removed: interface Document
  • removed: method Document.startViewTransition(cb: () => Promise<void> | void): ViewTransition
  • removed: var __reactRouterVersion: string
  • removed: var __staticRouterHydrationData: HydrationState | undefined
  • removed: const defaultMethod: HTMLFormMethod
  • removed: function createSearchParams(init?: URLSearchParamsInit): URLSearchParams
  • removed: function getFormSubmissionInfo(target: SubmitTarget, basename: string): { action: string | null; method: string; encType: string; formData: FormData | undefined; body: any }
  • removed: function getSearchParamsForLocation(locationSearch: string, defaultSearchParams: URLSearchParams | null): URLSearchParams
  • removed: function isButtonElement(object: any): object is HTMLButtonElement
  • removed: function isFormElement(object: any): object is HTMLFormElement
  • removed: function isHtmlElement(object: any): object is HTMLElement
  • removed: function isInputElement(object: any): object is HTMLInputElement
  • removed: function shouldProcessLinkClick(event: LimitedMouseEvent, target?: string): boolean
  • removed: interface FetcherSubmitOptions extends SharedSubmitOptions
  • removed: interface SubmitOptions extends FetcherSubmitOptions
  • removed: property SubmitOptions.fetcherKey?: string
  • removed: property SubmitOptions.navigate?: boolean
  • removed: property SubmitOptions.replace?: boolean
  • removed: property SubmitOptions.state?: any
  • removed: property SubmitOptions.viewTransition?: boolean
  • removed: type ParamKeyValuePair = [string, string]
  • removed: type SubmitTarget = HTMLFormElement | HTMLButtonElement | HTMLInputElement | FormData | URLSearchParams | JsonValue | null
  • removed: type URLSearchParamsInit = string | ParamKeyValuePair[] | Record<string, string | string[]> | URLSearchParams
  • removed: call FetcherSubmitFunction(target: SubmitTarget, options?: FetcherSubmitOptions): void
  • removed: call SubmitFunction(target: SubmitTarget, options?: SubmitOptions): void
  • removed: const Form: React.ForwardRefExoticComponent<FormProps & React.RefAttributes<HTMLFormElement>>
  • removed: const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>
  • removed: const NavLink: React.ForwardRefExoticComponent<NavLinkProps & React.RefAttributes<HTMLAnchorElement>>
  • removed: const UNSAFE_FetchersContext: React.Context<FetchersContextObject>
  • removed: const UNSAFE_ViewTransitionContext: React.Context<ViewTransitionContextObject>
  • removed: declare global
  • removed: export { AbortedDeferredError } from 'react-router'
  • removed: export { ActionFunction } from 'react-router'
  • removed: export { ActionFunctionArgs } from 'react-router'
  • removed: export { Await } from 'react-router'
  • removed: export { AwaitProps } from 'react-router'
  • removed: export { Blocker } from 'react-router'
  • removed: export { BlockerFunction } from 'react-router'
  • removed: export { DataRouteMatch } from 'react-router'
  • removed: export { DataRouteObject } from 'react-router'
  • removed: export { DataStrategyFunction } from 'react-router'
  • removed: export { DataStrategyFunctionArgs } from 'react-router'
  • removed: export { DataStrategyMatch } from 'react-router'
  • removed: export { DataStrategyResult } from 'react-router'
  • removed: export { ErrorResponse } from 'react-router'
  • removed: export { ErrorResponseImpl as UNSAFE_ErrorResponseImpl }
  • removed: export { Fetcher } from 'react-router'
  • removed: export { FormEncType }
  • removed: export { FormMethod }
  • removed: export { FutureConfig } from 'react-router'
  • removed: export { GetScrollRestorationKeyFunction }
  • removed: export { Hash } from 'react-router'
  • removed: export { IndexRouteObject } from 'react-router'
  • removed: export { IndexRouteProps } from 'react-router'
  • removed: export { JsonFunction } from 'react-router'
  • removed: export { LayoutRouteProps } from 'react-router'
  • removed: export { LazyRouteFunction } from 'react-router'
  • removed: export { LoaderFunction } from 'react-router'
  • removed: export { LoaderFunctionArgs } from 'react-router'
  • removed: export { Location } from 'react-router'
  • removed: export { MemoryRouter } from 'react-router'
  • removed: export { MemoryRouterProps } from 'react-router'
  • removed: export { Navigate } from 'react-router'
  • removed: export { NavigateFunction } from 'react-router'
  • removed: export { NavigateOptions } from 'react-router'
  • removed: export { NavigateProps } from 'react-router'
  • removed: export { Navigation } from 'react-router'
  • removed: export { NavigationType } from 'react-router'
  • removed: export { Navigator } from 'react-router'
  • removed: export { NonIndexRouteObject } from 'react-router'
  • removed: export { Outlet } from 'react-router'
  • removed: export { OutletProps } from 'react-router'
  • removed: export { ParamKeyValuePair }
  • removed: export { ParamParseKey } from 'react-router'
  • removed: export { Params } from 'react-router'
  • removed: export { PatchRoutesOnNavigationFunction } from 'react-router'
  • removed: export { PatchRoutesOnNavigationFunctionArgs } from 'react-router'
  • removed: export { Path } from 'react-router'
  • removed: export { PathMatch } from 'react-router'
  • removed: export { PathParam } from 'react-router'
  • removed: export { PathPattern } from 'react-router'
  • removed: export { PathRouteProps } from 'react-router'
  • removed: export { Pathname } from 'react-router'
  • removed: export { RedirectFunction } from 'react-router'
  • removed: export { RelativeRoutingType } from 'react-router'
  • removed: export { Route } from 'react-router'
  • removed: export { RouteMatch } from 'react-router'
  • removed: export { RouteObject } from 'react-router'
  • removed: export { RouteProps } from 'react-router'
  • removed: export { Router } from 'react-router'
  • removed: export { RouterProps } from 'react-router'
  • removed: export { RouterProviderProps } from 'react-router'
  • removed: export { Routes } from 'react-router'
  • removed: export { RoutesProps } from 'react-router'
  • removed: export { Search } from 'react-router'
  • removed: export { ShouldRevalidateFunction } from 'react-router'
  • removed: export { ShouldRevalidateFunctionArgs } from 'react-router'
  • removed: export { SubmitOptions }
  • removed: export { To } from 'react-router'
  • removed: export { UIMatch } from 'react-router'
  • removed: export { UNSAFE_DataRouterContext } from 'react-router'
  • removed: export { UNSAFE_DataRouterStateContext } from 'react-router'
  • removed: export { UNSAFE_LocationContext } from 'react-router'
  • removed: export { UNSAFE_NavigationContext } from 'react-router'
  • removed: export { UNSAFE_RouteContext } from 'react-router'
  • removed: export { UNSAFE_useRouteId } from 'react-router'
  • removed: export { URLSearchParamsInit }
  • removed: export { V7_FormMethod }
  • removed: export { createMemoryRouter } from 'react-router'
  • removed: export { createPath } from 'react-router'
  • removed: export { createRoutesFromChildren } from 'react-router'
  • removed: export { createRoutesFromElements } from 'react-router'
  • removed: export { createSearchParams }
  • removed: export { defer } from 'react-router'
  • removed: export { generatePath } from 'react-router'
  • removed: export { isRouteErrorResponse } from 'react-router'
  • removed: export { json } from 'react-router'
  • removed: export { matchPath } from 'react-router'
  • removed: export { matchRoutes } from 'react-router'
  • removed: export { parsePath } from 'react-router'
  • removed: export { redirect } from 'react-router'
  • removed: export { redirectDocument } from 'react-router'
  • removed: export { renderMatches } from 'react-router'
  • removed: export { replace } from 'react-router'
  • removed: export { resolvePath } from 'react-router'
  • removed: export { useActionData } from 'react-router'
  • removed: export { useAsyncError } from 'react-router'
  • removed: export { useAsyncValue } from 'react-router'
  • removed: export { useBlocker } from 'react-router'
  • removed: export { useHref } from 'react-router'
  • removed: export { useInRouterContext } from 'react-router'
  • removed: export { useLoaderData } from 'react-router'
  • removed: export { useLocation } from 'react-router'
  • removed: export { useMatch } from 'react-router'
  • removed: export { useMatches } from 'react-router'
  • removed: export { useNavigate } from 'react-router'
  • removed: export { useNavigation } from 'react-router'
  • removed: export { useNavigationType } from 'react-router'
  • removed: export { useOutlet } from 'react-router'
  • removed: export { useOutletContext } from 'react-router'
  • removed: export { useParams } from 'react-router'
  • removed: export { useResolvedPath } from 'react-router'
  • removed: export { useRevalidator } from 'react-router'
  • removed: export { useRouteError } from 'react-router'
  • removed: export { useRouteLoaderData } from 'react-router'
  • removed: export { useRoutes } from 'react-router'
  • removed: function BrowserRouter({ basename, children, future, window }: BrowserRouterProps): React.JSX.Element
  • removed: function HashRouter({ basename, children, future, window }: HashRouterProps): React.JSX.Element
  • removed: function RouterProvider({ fallbackElement, router, future }: RouterProviderProps): React.ReactElement
  • removed: function ScrollRestoration({ getKey, storageKey }: ScrollRestorationProps): null
  • removed: function UNSAFE_useScrollRestoration({ getKey, storageKey }?: { getKey?: GetScrollRestorationKeyFunction; storageKey?: string }): void
  • removed: function createBrowserRouter(routes: RouteObject[], opts?: DOMRouterOpts): RemixRouter
  • removed: function createHashRouter(routes: RouteObject[], opts?: DOMRouterOpts): RemixRouter
  • removed: function unstable_HistoryRouter({ basename, children, future, history }: HistoryRouterProps): React.JSX.Element
  • removed: function unstable_usePrompt({ when, message }: { when: boolean | BlockerFunction; message: string }): void
  • removed: function useBeforeUnload(callback: (event: BeforeUnloadEvent) => any, options?: { capture?: boolean }): void
  • removed: function useFetcher<TData = any>({ key }?: { key?: string }): FetcherWithComponents<TData>
  • removed: function useFetchers(): (Fetcher & { key: string })[]
  • removed: function useFormAction(action?: string, { relative }?: { relative?: RelativeRoutingType }): string
  • removed: function useLinkClickHandler<E extends Element = HTMLAnchorElement>(to: To, { target, replace: replaceProp, state, preventScrollReset, relative, viewTransition }?: { target?: React.HTMLAttributeAnchorTarget; replace?: boolean; state?: any; preventScrollReset?: boolean; relative?: RelativeRoutingType; viewTransition?: boolean }): (event: React.MouseEvent<E, MouseEvent>) => void
  • removed: function useSearchParams(defaultInit?: URLSearchParamsInit): [URLSearchParams, SetURLSearchParams]
  • removed: function useSubmit(): SubmitFunction
  • removed: function useViewTransitionState(to: To, opts?: { relative?: RelativeRoutingType }): boolean
  • removed: interface BrowserRouterProps
  • removed: interface FetcherFormProps extends SharedFormProps
  • removed: interface FetcherSubmitFunction
  • removed: interface FormProps extends SharedFormProps
  • removed: interface HashRouterProps
  • removed: interface HistoryRouterProps
  • removed: interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>
  • removed: interface NavLinkProps extends Omit<LinkProps, 'className' | 'style' | 'children'>
  • removed: interface ScrollRestorationProps
  • removed: interface SubmitFunction
  • removed: namespace ScrollRestoration
  • removed: namespace unstable_HistoryRouter
  • removed: property BrowserRouterProps.basename?: string
  • removed: property BrowserRouterProps.children?: React.ReactNode
  • removed: property BrowserRouterProps.future?: Partial<FutureConfig>
  • removed: property BrowserRouterProps.window?: Window
  • removed: property FormProps.fetcherKey?: string
  • removed: property FormProps.navigate?: boolean
  • removed: property FormProps.reloadDocument?: boolean
  • removed: property FormProps.replace?: boolean
  • removed: property FormProps.state?: any
  • removed: property FormProps.viewTransition?: boolean
  • removed: property HashRouterProps.basename?: string
  • removed: property HashRouterProps.children?: React.ReactNode
  • removed: property HashRouterProps.future?: Partial<FutureConfig>
  • removed: property HashRouterProps.window?: Window
  • removed: property HistoryRouterProps.basename?: string
  • removed: property HistoryRouterProps.children?: React.ReactNode
  • removed: property HistoryRouterProps.future?: FutureConfig
  • removed: property HistoryRouterProps.history: History
  • removed: property LinkProps.preventScrollReset?: boolean
  • removed: property LinkProps.relative?: RelativeRoutingType
  • removed: property LinkProps.reloadDocument?: boolean
  • removed: property LinkProps.replace?: boolean
  • removed: property LinkProps.state?: any
  • removed: property LinkProps.to: To
  • removed: property LinkProps.viewTransition?: boolean
  • removed: property NavLinkProps.caseSensitive?: boolean
  • removed: property NavLinkProps.children?: React.ReactNode | ((props: NavLinkRenderProps) => React.ReactNode)
  • removed: property NavLinkProps.className?: string | ((props: NavLinkRenderProps) => string | undefined)
  • removed: property NavLinkProps.end?: boolean
  • removed: property NavLinkProps.style?: React.CSSProperties | ((props: NavLinkRenderProps) => React.CSSProperties | undefined)
  • removed: property ScrollRestorationProps.getKey?: GetScrollRestorationKeyFunction
  • removed: property ScrollRestorationProps.storageKey?: string
  • removed: type FetcherWithComponents<TData> = Fetcher<TData> & { Form: React.ForwardRefExoticComponent<FetcherFormProps & React.RefAttributes<HTMLFormElement>>; submit: FetcherSubmitFunction; load: (href:…
  • removed: type NavLinkRenderProps = { isActive: boolean; isPending: boolean; isTransitioning: boolean }
  • removed: type SetURLSearchParams = (nextInit?: URLSearchParamsInit | ((prev: URLSearchParams) => URLSearchParamsInit), navigateOpts?: NavigateOptions) => void
  • removed: var ScrollRestoration.displayName: string
  • removed: var unstable_HistoryRouter.displayName: string
  • added: export * from 'react-router'
  • added: export { HydratedRouter } from 'react-router/dom'
  • added: export { RouterProvider } from 'react-router/dom'
  • added: export { RouterProviderProps } from 'react-router/dom'
  • removed: export { StaticHandlerContext }
  • removed: function StaticRouter({ basename, children, location: locationProp, future }: StaticRouterProps): React.JSX.Element
  • removed: function StaticRouterProvider({ context, router, hydrate, nonce }: StaticRouterProviderProps): React.JSX.Element
  • removed: function createStaticHandler(routes: RouteObject[], opts?: CreateStaticHandlerOptions): import('@remix-run/router').StaticHandler
  • removed: function createStaticRouter(routes: RouteObject[], context: StaticHandlerContext, opts?: { future?: Partial<Pick<RouterFutureConfig, 'v7_partialHydration' | 'v7_relativeSplatPath'>> }): RemixRouter
  • removed: interface StaticRouterProps
  • removed: interface StaticRouterProviderProps
  • removed: property StaticRouterProps.basename?: string
  • removed: property StaticRouterProps.children?: React.ReactNode
  • removed: property StaticRouterProps.future?: Partial<FutureConfig>
  • removed: property StaticRouterProps.location: Partial<Location> | string
  • removed: property StaticRouterProviderProps.context: StaticHandlerContext
  • removed: property StaticRouterProviderProps.hydrate?: boolean
  • removed: property StaticRouterProviderProps.nonce?: string
  • removed: property StaticRouterProviderProps.router: RemixRouter
  • removed: export { StaticHandlerContext }
  • removed: function StaticRouter({ basename, children, location: locationProp, future }: StaticRouterProps): React.JSX.Element
  • removed: function StaticRouterProvider({ context, router, hydrate, nonce }: StaticRouterProviderProps): React.JSX.Element
  • removed: function createStaticHandler(routes: RouteObject[], opts?: CreateStaticHandlerOptions): import('@remix-run/router').StaticHandler
  • removed: function createStaticRouter(routes: RouteObject[], context: StaticHandlerContext, opts?: { future?: Partial<Pick<RouterFutureConfig, 'v7_partialHydration' | 'v7_relativeSplatPath'>> }): RemixRouter
  • removed: interface StaticRouterProps
  • removed: interface StaticRouterProviderProps
  • removed: property StaticRouterProps.basename?: string
  • removed: property StaticRouterProps.children?: React.ReactNode
  • removed: property StaticRouterProps.future?: Partial<FutureConfig>
  • removed: property StaticRouterProps.location: Partial<Location> | string
  • removed: property StaticRouterProviderProps.context: StaticHandlerContext
  • removed: property StaticRouterProviderProps.hydrate?: boolean
  • removed: property StaticRouterProviderProps.nonce?: string
  • removed: property StaticRouterProviderProps.router: RemixRouter