Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deprecated-prop-type

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deprecated-prop-type

React Prop Type to mark a prop as deprecated

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

Keywords

FAQs

Package last updated on 18 Jul 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc