combined-proptypes
Example
; ComponentPropTypes = title: PropTypesstring counter: PropTypesnumber onPress: PropTypesfuncisRequired; ComponentdefaultProps = title: "no title" counter: 0;
becomes:
; ;
combined-proptypes
?
Why - Centralizes the setting of type and default value for props.
- Enforces safe coding practices by requiring you to provide a default value for optional props.
Supported PropTypes
Currently the following PropTypes are supported:
PropTypes.array
PropTypes.array.isRequired
PropTypes.string
PropTypes.string.isRequired
PropTypes.bool
PropTypes.bool.isRequired
PropTypes.func
PropTypes.func.isRequired
PropTypes.number
PropTypes.number.isRequired
PropTypes.object
PropTypes.object.isRequired
PropTypes.symbol
PropTypes.symbol.isRequired
More PropTypes might follow if I get around to it ;)