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

extended-proptypes

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extended-proptypes - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

lib/extend.js

2

package.json
{
"name": "extended-proptypes",
"version": "1.2.1",
"version": "1.2.2",
"description": "Useful proptypes for react components",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

[![Build Status](https://travis-ci.org/peterkhayes/extended-proptypes.svg?branch=master)](https://travis-ci.org/peterkhayes/extended-proptypes) [![Coverage Status](https://coveralls.io/repos/github/peterkhayes/extended-proptypes/badge.svg?branch=master)](https://coveralls.io/github/peterkhayes/extended-proptypes?branch=master)
# Extended Prop Types
Useful proptypes for React components. Developed for and tested on ClassDojo's web app.

@@ -18,17 +19,12 @@

You can also import the whole module and call it on `React.PropTypes`, extending
React's `PropTypes` with all included validators.
If you want to extend React's `PropTypes` with all included validators, you can
import `extended-proptypes/lib/extend`.
```js
import {PropTypes} from "react";
import ExtendedPropTypes from "extended-proptypes";
import `extended-proptypes/lib/extend`;
// New options will now be available on React's `PropTypes` export.
ExtendedPropTypes(PropTypes);
class MyComponent extends Component {
static propTypes = {
myDate: PropTypes.date,
mySatanicString: PropTypes.stringMatching(/^6+$/).isRequired,
myEmailAddress: PropTypes.emailAddress.isRequired,
myArrayOrObject: PropTypes.collectionOf(PropTypes.bool),

@@ -39,10 +35,16 @@ };

Finally, all validators are properties of the module.
Or, you can also import the whole module and call it on `React.PropTypes`.
```js
import {PropTypes} from "react";
import ExtendedPropTypes from "extended-proptypes";
// New options will now be available on React's `PropTypes` export.
ExtendedPropTypes(PropTypes);
class MyComponent extends Component {
static propTypes = {
myEmailAddress: ExtendedPropTypes.emailAddress.isRequired,
myDate: PropTypes.date.isRequired,
mySatanicString: PropTypes.stringMatching(/^6+$/).isRequired,
};

@@ -52,3 +54,2 @@ }

## New Prop Types

@@ -55,0 +56,0 @@

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