You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-router-prop-types

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router-prop-types

Runtime type checking for react-router props

1.0.5
latest
Source
npmnpm
Version published
Weekly downloads
30K
-5.84%
Maintainers
1
Weekly downloads
 
Created
Source

react-router-prop-types

Runtime type checking for react-router props

Installation

npm install react-router-prop-types --save

Usage

import React from 'react';
import ReactRouterPropTypes from 'react-router-prop-types';

class MyComponent extends React.Component {
  static propTypes = {
    // You can chain any of the above with `isRequired` to make sure a warning
    // is shown if the prop isn't provided.
    history: ReactRouterPropTypes.history.isRequired,
    location: ReactRouterPropTypes.location.isRequired,
    match: ReactRouterPropTypes.match.isRequired,
    route: ReactRouterPropTypes.route.isRequired, // for react-router-config
  }
  render() {
    // ...
  }
}

Keywords

react

FAQs

Package last updated on 01 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts