Description
Documentation: https://docs.mpi-internal.com/scmspain/all--lib-form-builder-docs/
Playground: https://form-builder-workbench.surge.sh/
$ npm install @s-ui/react-form-builder --save
import FormBuilder from '@s-ui/react-form-builder'
return <FormBuilder />
Find full description and more examples in the demo page.
To update a field programatically you can return an object from the async onChange callback, and the key values inside the object will trigger a change in the field.
In this example we are chaning the value of the field color
to yellow
allways.
const onChange = fields => {
...
return Promise.resolve({
color: 'yellow'
})
}
<FormBuilder
...
onChange={onChange}
/>