deprecated-prop-type

1.0.0 • Public • Published

deprecated-prop-type

deprectated prop type communicates to the developer that the marked prop should not be used.

Installation

yarn add deprecated-prop-type
 
#  
 
npm --save deprecated-prop-type

Usage

deprecated prop type takes two arguments: original prop type and reason for the deprecation. It will not show the warning if the original prop type failes.

import React from 'react';
import propTypes from 'prop-types';
import deprecated from 'deprecated-prop-type';
 
export default class MyComponent extends React.Component {
  static propTypes = {
    excludeDates: deprecated(propTypes.string, `Use excluded instead.`)
  }
 
  ...
}

Tests

npm install;
npm test

Credits

The code was taken from https://reactjs.org/warnings/dont-call-proptypes.html#fixing-the-false-positive-in-third-party-proptypes

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.019,340latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.019,340
1.0.0-beta10

Package Sidebar

Install

npm i deprecated-prop-type

Weekly Downloads

19,340

Version

1.0.0

License

ISC

Unpacked Size

3.37 kB

Total Files

4

Last publish

Collaborators

  • taras