Unify proptypes in util/proptypes.js (#3728)

* Unify proptypes in util/proptypes.js

* Add missing use of nodeOrStringProptype
This commit is contained in:
Jaco Greeff
2016-12-07 10:25:57 +01:00
committed by GitHub
parent 60680e1913
commit e2bb8ef6d1
15 changed files with 70 additions and 45 deletions

View File

@@ -16,6 +16,16 @@
import { PropTypes } from 'react';
export default function nullableProptype (type) {
return PropTypes.oneOfType([ PropTypes.oneOf([ null ]), type ]);
export function nullableProptype (type) {
return PropTypes.oneOfType([
PropTypes.oneOf([ null ]),
type
]);
}
export function nodeOrStringProptype () {
return PropTypes.oneOfType([
PropTypes.node,
PropTypes.string
]);
}