Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-is-deprecated
Advanced tools
Readme
Add an
isDeprecated
to your React PropTypes.
$ npm install --save react-is-deprecated
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.
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.
MIT © Brandon Dail
FAQs
Adds an isDeprecated method to the React.PropTypes object
The npm package react-is-deprecated receives a total of 15,817 weekly downloads. As such, react-is-deprecated popularity was classified as popular.
We found that react-is-deprecated demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.