File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
{"version":3,"file":"react-router-dom.development.js","sources":["../../../packages/react-router-dom/index.tsx"],"sourcesContent":["/**\n * NOTE: If you refactor this to split up the modules into separate files,\n * you'll need to update the rollup config for react-router-dom-v5-compat.\n */\nimport * as React from \"react\";\nimport type { BrowserHistory, HashHistory, History } from \"history\";\nimport { createBrowserHistory, createHashHistory } from \"history\";\nimport {\n MemoryRouter,\n Navigate,\n Outlet,\n Route,\n Router,\n Routes,\n createRoutesFromChildren,\n generatePath,\n matchRoutes,\n matchPath,\n createPath,\n parsePath,\n resolvePath,\n renderMatches,\n useHref,\n useInRouterContext,\n useLocation,\n useMatch,\n useNavigate,\n useNavigationType,\n useOutlet,\n useParams,\n useResolvedPath,\n useRoutes,\n useOutletContext,\n} from \"react-router\";\nimport type { To } from \"react-router\";\n\nfunction warning(cond: boolean, message: string): void {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n\n try {\n // Welcome to debugging React Router!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message);\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// RE-EXPORTS\n////////////////////////////////////////////////////////////////////////////////\n\n// Note: Keep in sync with react-router exports!\nexport {\n MemoryRouter,\n Navigate,\n Outlet,\n Route,\n Router,\n Routes,\n createRoutesFromChildren,\n generatePath,\n matchRoutes,\n matchPath,\n createPath,\n parsePath,\n renderMatches,\n resolvePath,\n useHref,\n useInRouterContext,\n useLocation,\n useMatch,\n useNavigate,\n useNavigationType,\n useOutlet,\n useParams,\n useResolvedPath,\n useRoutes,\n useOutletContext,\n};\n\nexport { NavigationType } from \"react-router\";\nexport type {\n Hash,\n Location,\n Path,\n To,\n MemoryRouterProps,\n NavigateFunction,\n NavigateOptions,\n NavigateProps,\n Navigator,\n OutletProps,\n Params,\n PathMatch,\n RouteMatch,\n RouteObject,\n RouteProps,\n PathRouteProps,\n LayoutRouteProps,\n IndexRouteProps,\n RouterProps,\n Pathname,\n Search,\n RoutesProps,\n} from \"react-router\";\n\n///////////////////////////////////////////////////////////////////////////////\n// DANGER! PLEASE READ ME!\n// We provide these exports as an escape hatch in the event that you need any\n// routing data that we don't provide an explicit API for. With that said, we\n// want to cover your use case if we can, so if you feel the need to use these\n// we want to hear from you. Let us know what you're building and we'll do our\n// best to make sure we can support you!\n//\n// We consider these exports an implementation detail and do not guarantee\n// against any breaking changes, regardless of the semver release. Use with\n// extreme caution and only if you understand the consequences. Godspeed.\n///////////////////////////////////////////////////////////////////////////////\n\n/** @internal */\nexport {\n UNSAFE_NavigationContext,\n UNSAFE_LocationContext,\n UNSAFE_RouteContext,\n} from \"react-router\";\n\n////////////////////////////////////////////////////////////////////////////////\n// COMPONENTS\n////////////////////////////////////////////////////////////////////////////////\n\nexport interface BrowserRouterProps {\n basename?: string;\n children?: React.ReactNode;\n window?: Window;\n}\n\n/**\n * A `<Router>` for use in web browsers. Provides the cleanest URLs.\n */\nexport function BrowserRouter({\n basename,\n children,\n window,\n}: BrowserRouterProps) {\n let historyRef = React.useRef<BrowserHistory>();\n if (historyRef.current == null) {\n historyRef.current = createBrowserHistory({ window });\n }\n\n let history = historyRef.current;\n let [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n <Router\n basename={basename}\n children={children}\n location={state.location}\n navigationType={state.action}\n navigator={history}\n />\n );\n}\n\nexport interface HashRouterProps {\n basename?: string;\n children?: React.ReactNode;\n window?: Window;\n}\n\n/**\n * A `<Router>` for use in web browsers. Stores the location in the hash\n * portion of the URL so it is not sent to the server.\n */\nexport function HashRouter({ basename, children, window }: HashRouterProps) {\n let historyRef = React.useRef<HashHistory>();\n if (historyRef.current == null) {\n historyRef.current = createHashHistory({ window });\n }\n\n let history = historyRef.current;\n let [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n <Router\n basename={basename}\n children={children}\n location={state.location}\n navigationType={state.action}\n navigator={history}\n />\n );\n}\n\nexport interface HistoryRouterProps {\n basename?: string;\n children?: React.ReactNode;\n history: History;\n}\n\n/**\n * A `<Router>` that accepts a pre-instantiated history object. It's important\n * to note that using your own history object is highly discouraged and may add\n * two versions of the history library to your bundles unless you use the same\n * version of the history library that React Router uses internally.\n */\nfunction HistoryRouter({ basename, children, history }: HistoryRouterProps) {\n const [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n <Router\n basename={basename}\n children={children}\n location={state.location}\n navigationType={state.action}\n navigator={history}\n />\n );\n}\n\nif (__DEV__) {\n HistoryRouter.displayName = \"unstable_HistoryRouter\";\n}\n\nexport { HistoryRouter as unstable_HistoryRouter };\n\nfunction isModifiedEvent(event: React.MouseEvent) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\nexport interface LinkProps\n extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> {\n reloadDocument?: boolean;\n replace?: boolean;\n state?: any;\n to: To;\n}\n\n/**\n * The public API for rendering a history-aware <a>.\n */\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(\n function LinkWithRef(\n { onClick, reloadDocument, replace = false, state, target, to, ...rest },\n ref\n ) {\n let href = useHref(to);\n let internalOnClick = useLinkClickHandler(to, { replace, state, target });\n function handleClick(\n event: React.MouseEvent<HTMLAnchorElement, MouseEvent>\n ) {\n if (onClick) onClick(event);\n if (!event.defaultPrevented && !reloadDocument) {\n internalOnClick(event);\n }\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/anchor-has-content\n <a\n {...rest}\n href={href}\n onClick={handleClick}\n ref={ref}\n target={target}\n />\n );\n }\n);\n\nif (__DEV__) {\n Link.displayName = \"Link\";\n}\n\nexport interface NavLinkProps\n extends Omit<LinkProps, \"className\" | \"style\" | \"children\"> {\n children?:\n | React.ReactNode\n | ((props: { isActive: boolean }) => React.ReactNode);\n caseSensitive?: boolean;\n className?: string | ((props: { isActive: boolean }) => string | undefined);\n end?: boolean;\n style?:\n | React.CSSProperties\n | ((props: { isActive: boolean }) => React.CSSProperties);\n}\n\n/**\n * A <Link> wrapper that knows if it's \"active\" or not.\n */\nexport const NavLink = React.forwardRef<HTMLAnchorElement, NavLinkProps>(\n function NavLinkWithRef(\n {\n \"aria-current\": ariaCurrentProp = \"page\",\n caseSensitive = false,\n className: classNameProp = \"\",\n end = false,\n style: styleProp,\n to,\n children,\n ...rest\n },\n ref\n ) {\n let location = useLocation();\n let path = useResolvedPath(to);\n\n let locationPathname = location.pathname;\n let toPathname = path.pathname;\n if (!caseSensitive) {\n locationPathname = locationPathname.toLowerCase();\n toPathname = toPathname.toLowerCase();\n }\n\n let isActive =\n locationPathname === toPathname ||\n (!end &&\n locationPathname.startsWith(toPathname) &&\n locationPathname.charAt(toPathname.length) === \"/\");\n\n let ariaCurrent = isActive ? ariaCurrentProp : undefined;\n\n let className: string | undefined;\n if (typeof classNameProp === \"function\") {\n className = classNameProp({ isActive });\n } else {\n // If the className prop is not a function, we use a default `active`\n // class for <NavLink />s that are active. In v5 `active` was the default\n // value for `activeClassName`, but we are removing that API and can still\n // use the old default behavior for a cleaner upgrade path and keep the\n // simple styling rules working as they currently do.\n className = [classNameProp, isActive ? \"active\" : null]\n .filter(Boolean)\n .join(\" \");\n }\n\n let style =\n typeof styleProp === \"function\" ? styleProp({ isActive }) : styleProp;\n\n return (\n <Link\n {...rest}\n aria-current={ariaCurrent}\n className={className}\n ref={ref}\n style={style}\n to={to}\n >\n {typeof children === \"function\" ? children({ isActive }) : children}\n </Link>\n );\n }\n);\n\nif (__DEV__) {\n NavLink.displayName = \"NavLink\";\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// HOOKS\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Handles the click behavior for router `<Link>` components. This is useful if\n * you need to create custom `<Link>` components with the same click behavior we\n * use in our exported `<Link>`.\n */\nexport function useLinkClickHandler<E extends Element = HTMLAnchorElement>(\n to: To,\n {\n target,\n replace: replaceProp,\n state,\n }: {\n target?: React.HTMLAttributeAnchorTarget;\n replace?: boolean;\n state?: any;\n } = {}\n): (event: React.MouseEvent<E, MouseEvent>) => void {\n let navigate = useNavigate();\n let location = useLocation();\n let path = useResolvedPath(to);\n\n return React.useCallback(\n (event: React.MouseEvent<E, MouseEvent>) => {\n if (\n event.button === 0 && // Ignore everything but left clicks\n (!target || target === \"_self\") && // Let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // Ignore clicks with modifier keys\n ) {\n event.preventDefault();\n\n // If the URL hasn't changed, a regular <a> will do a replace instead of\n // a push, so do the same here.\n let replace =\n !!replaceProp || createPath(location) === createPath(path);\n\n navigate(to, { replace, state });\n }\n },\n [location, navigate, path, replaceProp, state, target, to]\n );\n}\n\n/**\n * A convenient wrapper for reading and writing search parameters via the\n * URLSearchParams interface.\n */\nexport function useSearchParams(defaultInit?: URLSearchParamsInit) {\n warning(\n typeof URLSearchParams !== \"undefined\",\n `You cannot use the \\`useSearchParams\\` hook in a browser that does not ` +\n `support the URLSearchParams API. If you need to support Internet ` +\n `Explorer 11, we recommend you load a polyfill such as ` +\n `https://github.com/ungap/url-search-params\\n\\n` +\n `If you're unsure how to load polyfills, we recommend you check out ` +\n `https://polyfill.io/v3/ which provides some recommendations about how ` +\n `to load polyfills only for users that need them, instead of for every ` +\n `user.`\n );\n\n let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));\n\n let location = useLocation();\n let searchParams = React.useMemo(() => {\n let searchParams = createSearchParams(location.search);\n\n for (let key of defaultSearchParamsRef.current.keys()) {\n if (!searchParams.has(key)) {\n defaultSearchParamsRef.current.getAll(key).forEach((value) => {\n searchParams.append(key, value);\n });\n }\n }\n\n return searchParams;\n }, [location.search]);\n\n let navigate = useNavigate();\n let setSearchParams = React.useCallback(\n (\n nextInit: URLSearchParamsInit,\n navigateOptions?: { replace?: boolean; state?: any }\n ) => {\n navigate(\"?\" + createSearchParams(nextInit), navigateOptions);\n },\n [navigate]\n );\n\n return [searchParams, setSearchParams] as const;\n}\n\nexport type ParamKeyValuePair = [string, string];\n\nexport type URLSearchParamsInit =\n | string\n | ParamKeyValuePair[]\n | Record<string, string | string[]>\n | URLSearchParams;\n\n/**\n * Creates a URLSearchParams object using the given initializer.\n *\n * This is identical to `new URLSearchParams(init)` except it also\n * supports arrays as values in the object form of the initializer\n * instead of just strings. This is convenient when you need multiple\n * values for a given key, but don't want to use an array initializer.\n *\n * For example, instead of:\n *\n * let searchParams = new URLSearchParams([\n * ['sort', 'name'],\n * ['sort', 'price']\n * ]);\n *\n * you can do:\n *\n * let searchParams = createSearchParams({\n * sort: ['name', 'price']\n * });\n */\nexport function createSearchParams(\n init: URLSearchParamsInit = \"\"\n): URLSearchParams {\n return new URLSearchParams(\n typeof init === \"string\" ||\n Array.isArray(init) ||\n init instanceof URLSearchParams\n ? init\n : Object.keys(init).reduce((memo, key) => {\n let value = init[key];\n return memo.concat(\n Array.isArray(value) ? value.map((v) => [key, v]) : [[key, value]]\n );\n }, [] as ParamKeyValuePair[])\n );\n}\n"],"names":["warning","cond","message","console","warn","Error","e","BrowserRouter","basename","children","window","historyRef","React","current","createBrowserHistory","history","state","setState","action","location","listen","React.createElement","HashRouter","createHashHistory","HistoryRouter","displayName","isModifiedEvent","event","metaKey","altKey","ctrlKey","shiftKey","Link","LinkWithRef","onClick","reloadDocument","replace","target","to","rest","ref","href","useHref","internalOnClick","useLinkClickHandler","handleClick","defaultPrevented","NavLink","NavLinkWithRef","ariaCurrentProp","caseSensitive","className","classNameProp","end","style","styleProp","useLocation","path","useResolvedPath","locationPathname","pathname","toPathname","toLowerCase","isActive","startsWith","charAt","length","ariaCurrent","undefined","filter","Boolean","join","replaceProp","navigate","useNavigate","button","preventDefault","createPath","useSearchParams","defaultInit","URLSearchParams","defaultSearchParamsRef","createSearchParams","searchParams","search","key","keys","has","getAll","forEach","value","append","setSearchParams","nextInit","navigateOptions","init","Array","isArray","Object","reduce","memo","concat","map","v"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;;AAiCA,SAASA,OAAT,CAAiBC,IAAjB,EAAgCC,OAAhC,EAAuD;AACrD,MAAI,CAACD,IAAL,EAAW;AACT;AACA,QAAI,OAAOE,OAAP,KAAmB,WAAvB,EAAoCA,OAAO,CAACC,IAAR,CAAaF,OAAb;;AAEpC,QAAI;AACF;AACA;AACA;AACA;AACA;AACA,YAAM,IAAIG,KAAJ,CAAUH,OAAV,CAAN,CANE;AAQH,KARD,CAQE,OAAOI,CAAP,EAAU;AACb;AACF;AAkFD;AACA;;AAQA;AACA;AACA;AACO,SAASC,aAAT,CAAuB;AAC5BC,EAAAA,QAD4B;AAE5BC,EAAAA,QAF4B;AAG5BC,EAAAA;AAH4B,CAAvB,EAIgB;AACrB,MAAIC,UAAU,GAAGC,MAAA,EAAjB;;AACA,MAAID,UAAU,CAACE,OAAX,IAAsB,IAA1B,EAAgC;AAC9BF,IAAAA,UAAU,CAACE,OAAX,GAAqBC,oBAAoB,CAAC;AAAEJ,MAAAA;AAAF,KAAD,CAAzC;AACD;;AAED,MAAIK,OAAO,GAAGJ,UAAU,CAACE,OAAzB;AACA,MAAI,CAACG,KAAD,EAAQC,QAAR,IAAoBL,QAAA,CAAe;AACrCM,IAAAA,MAAM,EAAEH,OAAO,CAACG,MADqB;AAErCC,IAAAA,QAAQ,EAAEJ,OAAO,CAACI;AAFmB,GAAf,CAAxB;AAKAP,EAAAA,eAAA,CAAsB,MAAMG,OAAO,CAACK,MAAR,CAAeH,QAAf,CAA5B,EAAsD,CAACF,OAAD,CAAtD;AAEA,sBACEM,cAAC,MAAD;AACE,IAAA,QAAQ,EAAEb,QADZ;AAEE,IAAA,QAAQ,EAAEC,QAFZ;AAGE,IAAA,QA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