1.0.0 • Published 7 years ago

react-check-prop-types v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

react-check-prop-types

Dependency Status

Description

A small higher order component which helps you better check your props. This HoC will raise an error in the console if you pass a component a prop which is not defined in its propTypes.

Installation

With npm :

npm install react-check-prop-types

Usage

As a function

import checkPropTypes from 'react-check-prop-types'

class Component extends React.Component{
  // ...
}
export default checkPropTypes(Component)

As an ES7 decorator

import checkPropTypes from 'react-check-prop-types'

@checkPropTypes
export default class Component extends React.Component{
  // ...
}

Examples