Skip to content

pmirau/lib--react-form

Repository files navigation

Form

Current State

  • Basis is finished: New inputs can be implemented now. Further core-features can be implemented along the way when necessary

TODO

Guideline

Props, which every input component needs to include

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,
};

Notes

JOI

'.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 ...

About

A form for ReactJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published