UNPKG

@navinc/base-react-components

Version:
23 lines (20 loc) 695 B
All form-element components expect to be controlled components. This makes them immediately compatible with form managers like formik or redux-form, as well as within any stateful component. In addition to native form element attributes, all form-element components implement these props ``` <DatePicker errors={touched.businessStartDate && errors.businessStartDate} fieldsToShow={['year', 'month']} isInvalid={touched.businessStartDate && errors.businessStartDate} label='Business start date' onBlur={() => setFieldTouched('businessStartDate')} onChange={(e) => setFieldValue('businessStartDate', e.target.value)} value={{ day: 25, month: 12, year: 1950 }} /> ```