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

@types/react-router

Package Overview
Dependencies
Maintainers
1
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/react-router - npm Package Compare versions

Comparing version 5.1.11 to 5.1.12

33

react-router/index.d.ts

@@ -86,8 +86,11 @@ // Type definitions for React Router 5.1

export interface RouteProps {
export interface RouteProps<
Path extends string = string,
Params extends { [K: string]: string | undefined } = ExtractRouteParams<Path, string>
> {
location?: H.Location;
component?: React.ComponentType<RouteComponentProps<any>> | React.ComponentType<any>;
render?: (props: RouteComponentProps<any>) => React.ReactNode;
children?: ((props: RouteChildrenProps<any>) => React.ReactNode) | React.ReactNode;
path?: string | string[];
render?: (props: RouteComponentProps<Params>) => React.ReactNode;
children?: ((props: RouteChildrenProps<Params>) => React.ReactNode) | React.ReactNode;
path?: Path | Path[];
exact?: boolean;

@@ -97,3 +100,6 @@ sensitive?: boolean;

}
export class Route<T extends RouteProps = RouteProps> extends React.Component<T, any> {}
export class Route<T extends {} = {}, Path extends string = string> extends React.Component<
RouteProps<Path> & OmitNative<T, keyof RouteProps>,
any
> {}

@@ -133,2 +139,5 @@ export interface RouterProps {

// Newer Omit type: as the previous one is being exported, removing it would be a breaking change
export type OmitNative<T, K extends string | number | symbol> = { [P in Exclude<keyof T, K>]: T[P] };
export function matchPath<Params extends { [K in keyof Params]?: string }>(

@@ -140,12 +149,12 @@ pathname: string,

export type ExtractRouteOptionalParam<T extends string> = T extends `${infer Param}?`
? { [k in Param]?: string | number | boolean }
: { [k in T]: string | number | boolean };
export type ExtractRouteOptionalParam<T extends string, U = string | number | boolean> = T extends `${infer Param}?`
? { [k in Param]?: U }
: { [k in T]: U };
export type ExtractRouteParams<T extends string> = string extends T
? { [k in string]?: string | number | boolean }
export type ExtractRouteParams<T extends string, U = string | number | boolean> = string extends T
? { [k in string]?: U }
: T extends `${infer _Start}:${infer Param}/${infer Rest}`
? ExtractRouteOptionalParam<Param> & ExtractRouteParams<Rest>
? ExtractRouteOptionalParam<Param, U> & ExtractRouteParams<Rest, U>
: T extends `${infer _Start}:${infer Param}`
? ExtractRouteOptionalParam<Param>
? ExtractRouteOptionalParam<Param, U>
: {};

@@ -152,0 +161,0 @@

{
"name": "@types/react-router",
"version": "5.1.11",
"version": "5.1.12",
"description": "TypeScript definitions for React Router",

@@ -127,4 +127,4 @@ "license": "MIT",

},
"typesPublisherContentHash": "961c2fa917a2e0fb12404dd928f6e7ce482dd9b54353b0fca2443ffd9151937c",
"typeScriptVersion": "3.3"
"typesPublisherContentHash": "cbc35e382f4f32a43190d682ad28311613bf611cf4b9553a199a6d6c6a123249",
"typeScriptVersion": "3.4"
}

@@ -11,3 +11,3 @@ # Installation

### Additional Details
* Last updated: Fri, 08 Jan 2021 18:07:12 GMT
* Last updated: Mon, 01 Mar 2021 18:55:43 GMT
* Dependencies: [@types/react](https://npmjs.com/package/@types/react), [@types/history](https://npmjs.com/package/@types/history)

@@ -14,0 +14,0 @@ * Global values: none

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