Forms
Forms are based on react-final-form so you might consider reading the modules documentation too when needing more detail.
Code sample
The solution consist of:
form hoc
validate function
Input components (Textfield, Select)
form (HOC)
formOptions
name
description
validate
function taking current values returning an object containing all errors use the provided validate function
onSubmit
function that get called with values submitted
initialValues
initial values to set form fields to
...
The options can also be passed to the react-final-form via props.
Props passed to YourFormComponent
name
description
prestine
has changes?
handleCancel
function to call to cancel form editing
handleSubmit
function to call to submit changes
disableSubmit
same value as prestine -> avoid submit of form when there are no changes
...
all other props are passed through
Form components
Props
Name
Description
name
given name for that field (used in values passed to onSubmit and validate)
...
Available components
Last updated