Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-router-dom

Package Overview
Dependencies
Maintainers
3
Versions
459
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router-dom - npm Package Compare versions

Comparing version 6.0.2 to 6.1.0

19

index.d.ts
import * as React from "react";
import { MemoryRouter, Navigate, Outlet, Route, Router, Routes, createRoutesFromChildren, generatePath, matchRoutes, matchPath, resolvePath, renderMatches, useHref, useInRouterContext, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useParams, useResolvedPath, useRoutes } from "react-router";
import type { History } from "history";
import { MemoryRouter, Navigate, Outlet, Route, Router, Routes, createRoutesFromChildren, generatePath, matchRoutes, matchPath, resolvePath, renderMatches, useHref, useInRouterContext, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useParams, useResolvedPath, useRoutes, useOutletContext } from "react-router";
import type { To } from "react-router";
export { MemoryRouter, Navigate, Outlet, Route, Router, Routes, createRoutesFromChildren, generatePath, matchRoutes, matchPath, renderMatches, resolvePath, useHref, useInRouterContext, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useParams, useResolvedPath, useRoutes };
export { MemoryRouter, Navigate, Outlet, Route, Router, Routes, createRoutesFromChildren, generatePath, matchRoutes, matchPath, renderMatches, resolvePath, useHref, useInRouterContext, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useParams, useResolvedPath, useRoutes, useOutletContext };
export type { Location, Path, To, NavigationType, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigator, OutletProps, Params, PathMatch, RouteMatch, RouteObject, RouteProps, PathRouteProps, LayoutRouteProps, IndexRouteProps, RouterProps, RoutesProps } from "react-router";

@@ -27,2 +28,11 @@ /** @internal */

export declare function HashRouter({ basename, children, window }: HashRouterProps): JSX.Element;
export interface HistoryRouterProps {
basename?: string;
children?: React.ReactNode;
history: History;
}
export declare function HistoryRouter({ basename, children, history }: HistoryRouterProps): JSX.Element;
export declare namespace HistoryRouter {
var displayName: string;
}
export interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href"> {

@@ -38,3 +48,6 @@ reloadDocument?: boolean;

export declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
export interface NavLinkProps extends Omit<LinkProps, "className" | "style"> {
export interface NavLinkProps extends Omit<LinkProps, "className" | "style" | "children"> {
children: React.ReactNode | ((props: {
isActive: boolean;
}) => React.ReactNode);
caseSensitive?: boolean;

@@ -41,0 +54,0 @@ className?: string | ((props: {

50

index.js
/**
* React Router DOM v6.0.2
* React Router DOM v6.1.0
*

@@ -14,3 +14,3 @@ * Copyright (c) Remix Software Inc.

import { Router, useHref, useLocation, useResolvedPath, useNavigate } from 'react-router';
export { MemoryRouter, Navigate, Outlet, Route, Router, Routes, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, createRoutesFromChildren, generatePath, matchPath, matchRoutes, renderMatches, resolvePath, useHref, useInRouterContext, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useParams, useResolvedPath, useRoutes } from 'react-router';
export { MemoryRouter, Navigate, Outlet, Route, Router, Routes, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, createRoutesFromChildren, generatePath, matchPath, matchRoutes, renderMatches, resolvePath, useHref, useInRouterContext, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes } from 'react-router';

@@ -51,3 +51,3 @@ function _extends() {

const _excluded = ["onClick", "reloadDocument", "replace", "state", "target", "to"],
_excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to"];
_excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "children"];

@@ -136,3 +136,26 @@ function warning(cond, message) {

}
function HistoryRouter(_ref3) {
let {
basename,
children,
history
} = _ref3;
const [state, setState] = useState({
action: history.action,
location: history.location
});
useLayoutEffect(() => history.listen(setState), [history]);
return /*#__PURE__*/createElement(Router, {
basename: basename,
children: children,
location: state.location,
navigationType: state.action,
navigator: history
});
}
if (process.env.NODE_ENV !== "production") {
HistoryRouter.displayName = "HistoryRouter";
}
function isModifiedEvent(event) {

@@ -145,3 +168,3 @@ return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);

*/
const Link = /*#__PURE__*/forwardRef(function LinkWithRef(_ref3, ref) {
const Link = /*#__PURE__*/forwardRef(function LinkWithRef(_ref4, ref) {
let {

@@ -154,4 +177,4 @@ onClick,

to
} = _ref3,
rest = _objectWithoutPropertiesLoose(_ref3, _excluded);
} = _ref4,
rest = _objectWithoutPropertiesLoose(_ref4, _excluded);

@@ -192,3 +215,3 @@ let href = useHref(to);

*/
const NavLink = /*#__PURE__*/forwardRef(function NavLinkWithRef(_ref4, ref) {
const NavLink = /*#__PURE__*/forwardRef(function NavLinkWithRef(_ref5, ref) {
let {

@@ -200,5 +223,6 @@ "aria-current": ariaCurrentProp = "page",

style: styleProp,
to
} = _ref4,
rest = _objectWithoutPropertiesLoose(_ref4, _excluded2);
to,
children
} = _ref5,
rest = _objectWithoutPropertiesLoose(_ref5, _excluded2);

@@ -241,3 +265,5 @@ let location = useLocation();

to: to
}));
}), typeof children === "function" ? children({
isActive
}) : children);
});

@@ -344,3 +370,3 @@

export { BrowserRouter, HashRouter, Link, NavLink, createSearchParams, useLinkClickHandler, useSearchParams };
export { BrowserRouter, HashRouter, HistoryRouter, Link, NavLink, createSearchParams, useLinkClickHandler, useSearchParams };
//# sourceMappingURL=index.js.map
/**
* React Router DOM v6.0.2
* React Router DOM v6.1.0
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

{
"name": "react-router-dom",
"version": "6.0.2",
"version": "6.1.0",
"author": "Remix Software <hello@remix.run>",

@@ -17,3 +17,3 @@ "description": "Declarative routing for React web applications",

"dependencies": {
"react-router": "6.0.2",
"react-router": "6.1.0",
"history": "^5.1.0"

@@ -20,0 +20,0 @@ },

/**
* React Router DOM v6.0.2
* React Router DOM v6.1.0
*

@@ -14,3 +14,3 @@ * Copyright (c) Remix Software Inc.

import { Router, useHref, useLocation, useResolvedPath, useNavigate } from 'react-router';
export { MemoryRouter, Navigate, Outlet, Route, Router, Routes, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, createRoutesFromChildren, generatePath, matchPath, matchRoutes, renderMatches, resolvePath, useHref, useInRouterContext, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useParams, useResolvedPath, useRoutes } from 'react-router';
export { MemoryRouter, Navigate, Outlet, Route, Router, Routes, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, createRoutesFromChildren, generatePath, matchPath, matchRoutes, renderMatches, resolvePath, useHref, useInRouterContext, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes } from 'react-router';

@@ -97,3 +97,25 @@ function warning(cond, message) {

}
function HistoryRouter({
basename,
children,
history
}) {
const [state, setState] = useState({
action: history.action,
location: history.location
});
useLayoutEffect(() => history.listen(setState), [history]);
return /*#__PURE__*/createElement(Router, {
basename: basename,
children: children,
location: state.location,
navigationType: state.action,
navigator: history
});
}
{
HistoryRouter.displayName = "HistoryRouter";
}
function isModifiedEvent(event) {

@@ -156,2 +178,3 @@ return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);

to,
children,
...rest

@@ -195,3 +218,5 @@ }, ref) {

to: to
}));
}), typeof children === "function" ? children({
isActive
}) : children);
});

@@ -293,3 +318,3 @@

export { BrowserRouter, HashRouter, Link, NavLink, createSearchParams, useLinkClickHandler, useSearchParams };
export { BrowserRouter, HashRouter, HistoryRouter, Link, NavLink, createSearchParams, useLinkClickHandler, useSearchParams };
//# sourceMappingURL=react-router-dom.development.js.map
/**
* React Router DOM v6.0.2
* React Router DOM v6.1.0
*

@@ -11,3 +11,3 @@ * Copyright (c) Remix Software Inc.

*/
import{useRef as e,useState as t,useLayoutEffect as r,createElement as a,forwardRef as n,useCallback as o,useMemo as c}from"react";import{createBrowserHistory as i,createHashHistory as u,createPath as s}from"history";import{Router as l,useHref as f,useLocation as h,useResolvedPath as m,useNavigate as p}from"react-router";export{MemoryRouter,Navigate,Outlet,Route,Router,Routes,UNSAFE_LocationContext,UNSAFE_NavigationContext,UNSAFE_RouteContext,createRoutesFromChildren,generatePath,matchPath,matchRoutes,renderMatches,resolvePath,useHref,useInRouterContext,useLocation,useMatch,useNavigate,useNavigationType,useOutlet,useParams,useResolvedPath,useRoutes}from"react-router";function y({basename:n,children:o,window:c}){let u=e();null==u.current&&(u.current=i({window:c}));let s=u.current,[f,h]=t({action:s.action,location:s.location});return r((()=>s.listen(h)),[s]),a(l,{basename:n,children:o,location:f.location,navigationType:f.action,navigator:s})}function g({basename:n,children:o,window:c}){let i=e();null==i.current&&(i.current=u({window:c}));let s=i.current,[f,h]=t({action:s.action,location:s.location});return r((()=>s.listen(h)),[s]),a(l,{basename:n,children:o,location:f.location,navigationType:f.action,navigator:s})}const d=n((function({onClick:e,reloadDocument:t,replace:r=!1,state:n,target:o,to:c,...i},u){let s=f(c),l=R(c,{replace:r,state:n,target:o});return a("a",Object.assign({},i,{href:s,onClick:function(r){e&&e(r),r.defaultPrevented||t||l(r)},ref:u,target:o}))})),v=n((function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:n=!1,style:o,to:c,...i},u){let s=h(),l=m(c),f=s.pathname,p=l.pathname;t||(f=f.toLowerCase(),p=p.toLowerCase());let y,g=f===p||!n&&f.startsWith(p)&&"/"===f.charAt(p.length),v=g?e:void 0;y="function"==typeof r?r({isActive:g}):[r,g?"active":null].filter(Boolean).join(" ");let R="function"==typeof o?o({isActive:g}):o;return a(d,Object.assign({},i,{"aria-current":v,className:y,ref:u,style:R,to:c}))}));function R(e,{target:t,replace:r,state:a}={}){let n=p(),c=h(),i=m(e);return o((o=>{if(!(0!==o.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(o))){o.preventDefault();let t=!!r||s(c)===s(i);n(e,{replace:t,state:a})}}),[c,n,i,r,a,t,e])}function w(t){let r=e(A(t)),a=h(),n=c((()=>{let e=A(a.search);for(let t of r.current.keys())e.has(t)||r.current.getAll(t).forEach((r=>{e.append(t,r)}));return e}),[a.search]),i=p();return[n,o(((e,t)=>{i("?"+A(e),t)}),[i])]}function A(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map((e=>[r,e])):[[r,a]])}),[]))}export{y as BrowserRouter,g as HashRouter,d as Link,v as NavLink,A as createSearchParams,R as useLinkClickHandler,w as useSearchParams};
import{useRef as t,useState as e,useLayoutEffect as n,createElement as a,forwardRef as r,useCallback as o,useMemo as i}from"react";import{createBrowserHistory as c,createHashHistory as l,createPath as s}from"history";import{Router as u,useHref as f,useLocation as h,useResolvedPath as m,useNavigate as p}from"react-router";export{MemoryRouter,Navigate,Outlet,Route,Router,Routes,UNSAFE_LocationContext,UNSAFE_NavigationContext,UNSAFE_RouteContext,createRoutesFromChildren,generatePath,matchPath,matchRoutes,renderMatches,resolvePath,useHref,useInRouterContext,useLocation,useMatch,useNavigate,useNavigationType,useOutlet,useOutletContext,useParams,useResolvedPath,useRoutes}from"react-router";function y({basename:r,children:o,window:i}){let l=t();null==l.current&&(l.current=c({window:i}));let s=l.current,[f,h]=e({action:s.action,location:s.location});return n((()=>s.listen(h)),[s]),a(u,{basename:r,children:o,location:f.location,navigationType:f.action,navigator:s})}function d({basename:r,children:o,window:i}){let c=t();null==c.current&&(c.current=l({window:i}));let s=c.current,[f,h]=e({action:s.action,location:s.location});return n((()=>s.listen(h)),[s]),a(u,{basename:r,children:o,location:f.location,navigationType:f.action,navigator:s})}function g({basename:t,children:r,history:o}){const[i,c]=e({action:o.action,location:o.location});return n((()=>o.listen(c)),[o]),a(u,{basename:t,children:r,location:i.location,navigationType:i.action,navigator:o})}const v=r((function({onClick:t,reloadDocument:e,replace:n=!1,state:r,target:o,to:i,...c},l){let s=f(i),u=R(i,{replace:n,state:r,target:o});return a("a",Object.assign({},c,{href:s,onClick:function(n){t&&t(n),n.defaultPrevented||e||u(n)},ref:l,target:o}))})),A=r((function({"aria-current":t="page",caseSensitive:e=!1,className:n="",end:r=!1,style:o,to:i,children:c,...l},s){let u=h(),f=m(i),p=u.pathname,y=f.pathname;e||(p=p.toLowerCase(),y=y.toLowerCase());let d,g=p===y||!r&&p.startsWith(y)&&"/"===p.charAt(y.length),A=g?t:void 0;d="function"==typeof n?n({isActive:g}):[n,g?"active":null].filter(Boolean).join(" ");let R="function"==typeof o?o({isActive:g}):o;return a(v,Object.assign({},l,{"aria-current":A,className:d,ref:s,style:R,to:i}),"function"==typeof c?c({isActive:g}):c)}));function R(t,{target:e,replace:n,state:a}={}){let r=p(),i=h(),c=m(t);return o((o=>{if(!(0!==o.button||e&&"_self"!==e||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(o))){o.preventDefault();let e=!!n||s(i)===s(c);r(t,{replace:e,state:a})}}),[i,r,c,n,a,e,t])}function w(e){let n=t(b(e)),a=h(),r=i((()=>{let t=b(a.search);for(let e of n.current.keys())t.has(e)||n.current.getAll(e).forEach((n=>{t.append(e,n)}));return t}),[a.search]),c=p();return[r,o(((t,e)=>{c("?"+b(t),e)}),[c])]}function b(t=""){return new URLSearchParams("string"==typeof t||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce(((e,n)=>{let a=t[n];return e.concat(Array.isArray(a)?a.map((t=>[n,t])):[[n,a]])}),[]))}export{y as BrowserRouter,d as HashRouter,g as HistoryRouter,v as Link,A as NavLink,b as createSearchParams,R as useLinkClickHandler,w as useSearchParams};
//# sourceMappingURL=react-router-dom.production.min.js.map
/**
* React Router DOM v6.0.2
* React Router DOM v6.1.0
*

@@ -51,3 +51,3 @@ * Copyright (c) Remix Software Inc.

const _excluded = ["onClick", "reloadDocument", "replace", "state", "target", "to"],
_excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to"];
_excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "children"];

@@ -136,3 +136,26 @@ function warning(cond, message) {

}
function HistoryRouter(_ref3) {
let {
basename,
children,
history
} = _ref3;
const [state, setState] = React.useState({
action: history.action,
location: history.location
});
React.useLayoutEffect(() => history.listen(setState), [history]);
return /*#__PURE__*/React.createElement(reactRouter.Router, {
basename: basename,
children: children,
location: state.location,
navigationType: state.action,
navigator: history
});
}
{
HistoryRouter.displayName = "HistoryRouter";
}
function isModifiedEvent(event) {

@@ -145,3 +168,3 @@ return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);

*/
const Link = /*#__PURE__*/React.forwardRef(function LinkWithRef(_ref3, ref) {
const Link = /*#__PURE__*/React.forwardRef(function LinkWithRef(_ref4, ref) {
let {

@@ -154,4 +177,4 @@ onClick,

to
} = _ref3,
rest = _objectWithoutPropertiesLoose(_ref3, _excluded);
} = _ref4,
rest = _objectWithoutPropertiesLoose(_ref4, _excluded);

@@ -192,3 +215,3 @@ let href = reactRouter.useHref(to);

*/
const NavLink = /*#__PURE__*/React.forwardRef(function NavLinkWithRef(_ref4, ref) {
const NavLink = /*#__PURE__*/React.forwardRef(function NavLinkWithRef(_ref5, ref) {
let {

@@ -200,5 +223,6 @@ "aria-current": ariaCurrentProp = "page",

style: styleProp,
to
} = _ref4,
rest = _objectWithoutPropertiesLoose(_ref4, _excluded2);
to,
children
} = _ref5,
rest = _objectWithoutPropertiesLoose(_ref5, _excluded2);

@@ -241,3 +265,5 @@ let location = reactRouter.useLocation();

to: to
}));
}), typeof children === "function" ? children({
isActive
}) : children);
});

@@ -476,2 +502,8 @@

});
Object.defineProperty(exports, 'useOutletContext', {
enumerable: true,
get: function () {
return reactRouter.useOutletContext;
}
});
Object.defineProperty(exports, 'useParams', {

@@ -497,2 +529,3 @@ enumerable: true,

exports.HashRouter = HashRouter;
exports.HistoryRouter = HistoryRouter;
exports.Link = Link;

@@ -499,0 +532,0 @@ exports.NavLink = NavLink;

/**
* React Router DOM v6.0.2
* React Router DOM v6.1.0
*

@@ -11,3 +11,3 @@ * Copyright (c) Remix Software Inc.

*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("history"),require("react-router")):"function"==typeof define&&define.amd?define(["exports","react","history","react-router"],t):t((e=e||self).ReactRouterDOM={},e.React,e.HistoryLibrary,e.ReactRouter)}(this,(function(e,t,r,n){"use strict";function a(){return a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a.apply(this,arguments)}function o(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}const u=["onClick","reloadDocument","replace","state","target","to"],c=["aria-current","caseSensitive","className","end","style","to"];const i=t.forwardRef((function(e,r){let{onClick:c,reloadDocument:i,replace:s=!1,state:f,target:d,to:b}=e,y=o(e,u),m=n.useHref(b),p=l(b,{replace:s,state:f,target:d});return t.createElement("a",a({},y,{href:m,onClick:function(e){c&&c(e),e.defaultPrevented||i||p(e)},ref:r,target:d}))})),s=t.forwardRef((function(e,r){let{"aria-current":u="page",caseSensitive:s=!1,className:l="",end:f=!1,style:d,to:b}=e,y=o(e,c),m=n.useLocation(),p=n.useResolvedPath(b),g=m.pathname,h=p.pathname;s||(g=g.toLowerCase(),h=h.toLowerCase());let P,R=g===h||!f&&g.startsWith(h)&&"/"===g.charAt(h.length),O=R?u:void 0;P="function"==typeof l?l({isActive:R}):[l,R?"active":null].filter(Boolean).join(" ");let v="function"==typeof d?d({isActive:R}):d;return t.createElement(i,a({},y,{"aria-current":O,className:P,ref:r,style:v,to:b}))}));function l(e,a){let{target:o,replace:u,state:c}=void 0===a?{}:a,i=n.useNavigate(),s=n.useLocation(),l=n.useResolvedPath(e);return t.useCallback((t=>{if(!(0!==t.button||o&&"_self"!==o||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(t))){t.preventDefault();let n=!!u||r.createPath(s)===r.createPath(l);i(e,{replace:n,state:c})}}),[s,i,l,u,c,o,e])}function f(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map((e=>[r,e])):[[r,n]])}),[]))}Object.defineProperty(e,"MemoryRouter",{enumerable:!0,get:function(){return n.MemoryRouter}}),Object.defineProperty(e,"Navigate",{enumerable:!0,get:function(){return n.Navigate}}),Object.defineProperty(e,"Outlet",{enumerable:!0,get:function(){return n.Outlet}}),Object.defineProperty(e,"Route",{enumerable:!0,get:function(){return n.Route}}),Object.defineProperty(e,"Router",{enumerable:!0,get:function(){return n.Router}}),Object.defineProperty(e,"Routes",{enumerable:!0,get:function(){return n.Routes}}),Object.defineProperty(e,"UNSAFE_LocationContext",{enumerable:!0,get:function(){return n.UNSAFE_LocationContext}}),Object.defineProperty(e,"UNSAFE_NavigationContext",{enumerable:!0,get:function(){return n.UNSAFE_NavigationContext}}),Object.defineProperty(e,"UNSAFE_RouteContext",{enumerable:!0,get:function(){return n.UNSAFE_RouteContext}}),Object.defineProperty(e,"createRoutesFromChildren",{enumerable:!0,get:function(){return n.createRoutesFromChildren}}),Object.defineProperty(e,"generatePath",{enumerable:!0,get:function(){return n.generatePath}}),Object.defineProperty(e,"matchPath",{enumerable:!0,get:function(){return n.matchPath}}),Object.defineProperty(e,"matchRoutes",{enumerable:!0,get:function(){return n.matchRoutes}}),Object.defineProperty(e,"renderMatches",{enumerable:!0,get:function(){return n.renderMatches}}),Object.defineProperty(e,"resolvePath",{enumerable:!0,get:function(){return n.resolvePath}}),Object.defineProperty(e,"useHref",{enumerable:!0,get:function(){return n.useHref}}),Object.defineProperty(e,"useInRouterContext",{enumerable:!0,get:function(){return n.useInRouterContext}}),Object.defineProperty(e,"useLocation",{enumerable:!0,get:function(){return n.useLocation}}),Object.defineProperty(e,"useMatch",{enumerable:!0,get:function(){return n.useMatch}}),Object.defineProperty(e,"useNavigate",{enumerable:!0,get:function(){return n.useNavigate}}),Object.defineProperty(e,"useNavigationType",{enumerable:!0,get:function(){return n.useNavigationType}}),Object.defineProperty(e,"useOutlet",{enumerable:!0,get:function(){return n.useOutlet}}),Object.defineProperty(e,"useParams",{enumerable:!0,get:function(){return n.useParams}}),Object.defineProperty(e,"useResolvedPath",{enumerable:!0,get:function(){return n.useResolvedPath}}),Object.defineProperty(e,"useRoutes",{enumerable:!0,get:function(){return n.useRoutes}}),e.BrowserRouter=function(e){let{basename:a,children:o,window:u}=e,c=t.useRef();null==c.current&&(c.current=r.createBrowserHistory({window:u}));let i=c.current,[s,l]=t.useState({action:i.action,location:i.location});return t.useLayoutEffect((()=>i.listen(l)),[i]),t.createElement(n.Router,{basename:a,children:o,location:s.location,navigationType:s.action,navigator:i})},e.HashRouter=function(e){let{basename:a,children:o,window:u}=e,c=t.useRef();null==c.current&&(c.current=r.createHashHistory({window:u}));let i=c.current,[s,l]=t.useState({action:i.action,location:i.location});return t.useLayoutEffect((()=>i.listen(l)),[i]),t.createElement(n.Router,{basename:a,children:o,location:s.location,navigationType:s.action,navigator:i})},e.Link=i,e.NavLink=s,e.createSearchParams=f,e.useLinkClickHandler=l,e.useSearchParams=function(e){let r=t.useRef(f(e)),a=n.useLocation(),o=t.useMemo((()=>{let e=f(a.search);for(let t of r.current.keys())e.has(t)||r.current.getAll(t).forEach((r=>{e.append(t,r)}));return e}),[a.search]),u=n.useNavigate();return[o,t.useCallback(((e,t)=>{u("?"+f(e),t)}),[u])]},Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("history"),require("react-router")):"function"==typeof define&&define.amd?define(["exports","react","history","react-router"],t):t((e=e||self).ReactRouterDOM={},e.React,e.HistoryLibrary,e.ReactRouter)}(this,(function(e,t,r,n){"use strict";function o(){return o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o.apply(this,arguments)}function a(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}const u=["onClick","reloadDocument","replace","state","target","to"],i=["aria-current","caseSensitive","className","end","style","to","children"];const c=t.forwardRef((function(e,r){let{onClick:i,reloadDocument:c,replace:s=!1,state:f,target:d,to:y}=e,b=a(e,u),m=n.useHref(y),p=l(y,{replace:s,state:f,target:d});return t.createElement("a",o({},b,{href:m,onClick:function(e){i&&i(e),e.defaultPrevented||c||p(e)},ref:r,target:d}))})),s=t.forwardRef((function(e,r){let{"aria-current":u="page",caseSensitive:s=!1,className:l="",end:f=!1,style:d,to:y,children:b}=e,m=a(e,i),p=n.useLocation(),g=n.useResolvedPath(y),h=p.pathname,P=g.pathname;s||(h=h.toLowerCase(),P=P.toLowerCase());let O,R=h===P||!f&&h.startsWith(P)&&"/"===h.charAt(P.length),v=R?u:void 0;O="function"==typeof l?l({isActive:R}):[l,R?"active":null].filter(Boolean).join(" ");let j="function"==typeof d?d({isActive:R}):d;return t.createElement(c,o({},m,{"aria-current":v,className:O,ref:r,style:j,to:y}),"function"==typeof b?b({isActive:R}):b)}));function l(e,o){let{target:a,replace:u,state:i}=void 0===o?{}:o,c=n.useNavigate(),s=n.useLocation(),l=n.useResolvedPath(e);return t.useCallback((t=>{if(!(0!==t.button||a&&"_self"!==a||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(t))){t.preventDefault();let n=!!u||r.createPath(s)===r.createPath(l);c(e,{replace:n,state:i})}}),[s,c,l,u,i,a,e])}function f(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map((e=>[r,e])):[[r,n]])}),[]))}Object.defineProperty(e,"MemoryRouter",{enumerable:!0,get:function(){return n.MemoryRouter}}),Object.defineProperty(e,"Navigate",{enumerable:!0,get:function(){return n.Navigate}}),Object.defineProperty(e,"Outlet",{enumerable:!0,get:function(){return n.Outlet}}),Object.defineProperty(e,"Route",{enumerable:!0,get:function(){return n.Route}}),Object.defineProperty(e,"Router",{enumerable:!0,get:function(){return n.Router}}),Object.defineProperty(e,"Routes",{enumerable:!0,get:function(){return n.Routes}}),Object.defineProperty(e,"UNSAFE_LocationContext",{enumerable:!0,get:function(){return n.UNSAFE_LocationContext}}),Object.defineProperty(e,"UNSAFE_NavigationContext",{enumerable:!0,get:function(){return n.UNSAFE_NavigationContext}}),Object.defineProperty(e,"UNSAFE_RouteContext",{enumerable:!0,get:function(){return n.UNSAFE_RouteContext}}),Object.defineProperty(e,"createRoutesFromChildren",{enumerable:!0,get:function(){return n.createRoutesFromChildren}}),Object.defineProperty(e,"generatePath",{enumerable:!0,get:function(){return n.generatePath}}),Object.defineProperty(e,"matchPath",{enumerable:!0,get:function(){return n.matchPath}}),Object.defineProperty(e,"matchRoutes",{enumerable:!0,get:function(){return n.matchRoutes}}),Object.defineProperty(e,"renderMatches",{enumerable:!0,get:function(){return n.renderMatches}}),Object.defineProperty(e,"resolvePath",{enumerable:!0,get:function(){return n.resolvePath}}),Object.defineProperty(e,"useHref",{enumerable:!0,get:function(){return n.useHref}}),Object.defineProperty(e,"useInRouterContext",{enumerable:!0,get:function(){return n.useInRouterContext}}),Object.defineProperty(e,"useLocation",{enumerable:!0,get:function(){return n.useLocation}}),Object.defineProperty(e,"useMatch",{enumerable:!0,get:function(){return n.useMatch}}),Object.defineProperty(e,"useNavigate",{enumerable:!0,get:function(){return n.useNavigate}}),Object.defineProperty(e,"useNavigationType",{enumerable:!0,get:function(){return n.useNavigationType}}),Object.defineProperty(e,"useOutlet",{enumerable:!0,get:function(){return n.useOutlet}}),Object.defineProperty(e,"useOutletContext",{enumerable:!0,get:function(){return n.useOutletContext}}),Object.defineProperty(e,"useParams",{enumerable:!0,get:function(){return n.useParams}}),Object.defineProperty(e,"useResolvedPath",{enumerable:!0,get:function(){return n.useResolvedPath}}),Object.defineProperty(e,"useRoutes",{enumerable:!0,get:function(){return n.useRoutes}}),e.BrowserRouter=function(e){let{basename:o,children:a,window:u}=e,i=t.useRef();null==i.current&&(i.current=r.createBrowserHistory({window:u}));let c=i.current,[s,l]=t.useState({action:c.action,location:c.location});return t.useLayoutEffect((()=>c.listen(l)),[c]),t.createElement(n.Router,{basename:o,children:a,location:s.location,navigationType:s.action,navigator:c})},e.HashRouter=function(e){let{basename:o,children:a,window:u}=e,i=t.useRef();null==i.current&&(i.current=r.createHashHistory({window:u}));let c=i.current,[s,l]=t.useState({action:c.action,location:c.location});return t.useLayoutEffect((()=>c.listen(l)),[c]),t.createElement(n.Router,{basename:o,children:a,location:s.location,navigationType:s.action,navigator:c})},e.HistoryRouter=function(e){let{basename:r,children:o,history:a}=e;const[u,i]=t.useState({action:a.action,location:a.location});return t.useLayoutEffect((()=>a.listen(i)),[a]),t.createElement(n.Router,{basename:r,children:o,location:u.location,navigationType:u.action,navigator:a})},e.Link=c,e.NavLink=s,e.createSearchParams=f,e.useLinkClickHandler=l,e.useSearchParams=function(e){let r=t.useRef(f(e)),o=n.useLocation(),a=t.useMemo((()=>{let e=f(o.search);for(let t of r.current.keys())e.has(t)||r.current.getAll(t).forEach((r=>{e.append(t,r)}));return e}),[o.search]),u=n.useNavigate();return[a,t.useCallback(((e,t)=>{u("?"+f(e),t)}),[u])]},Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=react-router-dom.production.min.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc