Thank you for reading my question.
I am using FormIO in my react application to render a form builder. I need to limit the components available to drag-n-drop to only certain ones–very much like how this official FormIO doc says: https://formio.github.io/formio.js/app/examples/custombuilder.html
Here is my Form Builder options component:
import { FormBuilder } from 'react-formio'
<FormBuilder
form={{ display: 'form' }}
onChange={schema => setSchema(schema)}
options={{
builder: {
layout: false,
premium: false,
basic: {
default: true,
components: {
password: false,
radio: false,
button: false,
},
},
advanced: {
default: true,
components: {
signature: false,
},
},
},
}}
/>
As you can see Id like to remove: layout
, premium
and parts of the basic
and advanced
. I also mean to keep all components from the data
section, but adding the data: true
breaks everything even more. With this options object, the form builder DOES hide the particular requested fields but the moment you try to expand a component section (like data) this error appears on the console and you are unable to expand:
Warning: unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering.
The moment you try to drag and drop a component to make your form the app crashes with this other error:
Uncaught TypeError: Failed to execute 'elementFromPoint' on 'Document': The provided double value is non-finite.
What am I doing wrong?