react-form-builder
react-form-builder copied to clipboard
Missing 'data' type definition in FormBuilderProps.
In my typescript project, I'm not able to pass data to FormBuilder. I get data.ForEach is not a function error. But, I noticed it works on fine on normal JS project.
const handleFormBuilderLoad: () => Promise<FormBuilderPostData> = async () => {
console.log(data.inputs)
const formData: FormBuilderPostData = {
task_data: data.inputs as TaskData[],
};
return formData;
}
<ReactFormBuilder
onLoad={handleFormBuilderLoad}
onPost={handleLogToConsole}
toolbarItems={completeItems as any} // Customize toolbar items
/>
I tried to load FormBuilderPostData using onLoad props and was unsuccessfull.
If you need help to resolve issue then please create github project showing your problem. I am not using TS with this project, so it is hard to replicate problem by myself.