MCPcopy Index your code
hub / github.com/aweary/react-is-deprecated

github.com/aweary/react-is-deprecated @0.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.1.0 ↗ · + Follow
4 symbols 5 edges 3 files 2 documented · 50% updated 8y ago0.1.0 · 2016-03-28★ 442 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

react-is-deprecated

Add an isDeprecated to your React PropTypes.

Install

$ npm install --save react-is-deprecated

Usage

react-is-deprecated provides two options for wrapping React.PropTypes. You can use the deprecate function (recommended) to wrap a specific type and output a warning whenever the prop is defined:


static propTypes = {
  deprecated: deprecate(PropTypes.string, `Your message here`)
}

If you'd like to have an isDeprecated function attached to all React.PropTypes options you can use addIsDeprecated.


const PropTypes = addIsDeprecated(React.PropTypes);
...
static propTypes = {
  deprecated: PropTypes.object.isDeprecated('Your message here.')
}

Note: addIsDeprecated returns a copy of the passed PropTypes instance and does not mutate the React.PropTypes. isDeprecated will only work on the PropType object returned.

API

deprecate(propType: React.PropTypes.[type], message: string)

Returns a function wrapping the propType argument with a check to determine if the prop is defined and, if so, log out a warning via console.warn once.

addIsDeprecated(input: React.PropTypes)

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

[type].isDeprecated(message: string)

If you use the addIsDeprecated function to return a new copy of React.PropTypes then each type will have an isDeprecated message. It is identical to deprecate with the exception that it is already bound to the [type] and just accepts the message.

License

MIT © Brandon Dail

Core symbols most depended-on inside this repo

addIsDeprecated
called by 2
dist.js
deprecate
called by 0
dist.js
deprecate
called by 0
index.js
addIsDeprecated
called by 0
index.js

Shape

Function 4

Languages

TypeScript100%

Modules by API surface

index.js2 symbols
dist.js2 symbols

For agents

$ claude mcp add react-is-deprecated \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact