JSPM

react-is-deprecated

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16169
  • Score
    100M100P100Q136989F
  • License MIT

Adds an isDeprecated method to the React.PropTypes object

Package Exports

  • react-is-deprecated

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-is-deprecated) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-is-deprecated

Add an isDeprecated to your React PropTypes.

Install

$ npm install --save react-is-deprecated

Usage

import React from 'react';
import addIsDeprecated from 'react-is-deprecated';
const PropTypes = addIsDeprecated(React.PropTypes);

export default class SomeComponent extends React.Component {
  static propTypes = {
    deprecated: PropTypes.string.isDeprecated(`'deprecated' is deprecated, please use 'notDeprecated.'`),
    notDeprecated: PropTypes.string
  }
}

API

addIsDeprecated(input: React.Proptypes)

Returns an augmented version of React.PropTypes with isDeprecated added to all top level properties.

React.PropTypes.[type].isDeprecated(message: string)

Returns the [type] it is called on and uses console.warn to log out the message.

License

MIT © Brandon Dail