react-form-builder icon indicating copy to clipboard operation
react-form-builder copied to clipboard

Missing 'data' type definition in FormBuilderProps.

Open Sushmit1997 opened this issue 1 year ago • 1 comments

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.

Sushmit1997 avatar Dec 19 '23 07:12 Sushmit1997

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.

Kiho avatar Dec 22 '23 13:12 Kiho