- Basis is finished: New inputs can be implemented now. Further core-features can be implemented along the way when necessary
- When creating a package from this module: Use eslint files etc.
- https://reactjs.org/docs/accessibility.html#notifying-the-user-of-errors
const defaultProps = {
id: PropTypes.string.isRequired,
onChange: PropTypes.func.isRequired,
onBlur: PropTypes.func.isRequired,
error: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool,
]),
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
// define appropriately
]),
disabled: PropTypes.bool,
};'.required() & .optional() are presence flags, not validity/constraints' (hapijs/joi#482 (comment))
'Once the presence requirement is done, then you move on to validation'
Currently, using .empty() to make required/optional work. Ok for the long run?
// not thoroughly thought through, if .empty() is ok. Or if the empty value
// sometimes needs to be run through the validator as well ...