Skip to content

Commit

Permalink
mapOf and setOf validators
Browse files Browse the repository at this point in the history
  • Loading branch information
conartist6 committed Sep 3, 2019
1 parent bef0803 commit 2a391b0
Show file tree
Hide file tree
Showing 8 changed files with 1,604 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ MyComponent.propTypes = {
// An array of a certain type
optionalArrayOf: PropTypes.arrayOf(PropTypes.number),

// A two item array of [string, number]
optionalTupleOf: PropTypes.tupleOf([PropTypes.string, PropTypes.number]),

// An iterable of a certain type
optionalIterableOf: PropTypes.iterableOf(PropTypes.number),

// An es6 Map containing certain types of keys and values
optionalMapOf: PropTypes.mapOf([PropTypes.string, PropTypes.number]),

// An es6 Set containing certain types of values
optionalSetOf: PropTypes.setOf(PropTypes.number),

// An object with property values of a certain type
optionalObjectOf: PropTypes.objectOf(PropTypes.number),

Expand Down

0 comments on commit 2a391b0

Please sign in to comment.