formio.js icon indicating copy to clipboard operation
formio.js copied to clipboard

[QUESTION] Trouble creating a custom component for the FormBuilder using Typescript

Open frances-datacom opened this issue 1 year ago • 1 comments

Hi,

I'm having trouble using FormIO in React with Typescript. Please see this link: https://codesandbox.io/p/devbox/blissful-hill-7f9qfr

Here, I have a custom component called ImageDraw. It shows up in the sidebar, and can be dragged/dropped onto the FormBuilder. However, the edit dialog and the UI on the FormBuilder don't render properly. It seems that it is not picking up the builderInfo etc from the component. I am missing something here, and I don't know what.

Any help would be greatly appreciated.

image

image

frances-datacom avatar Jul 03 '24 20:07 frances-datacom

Hi, you need to specify the type of the component as the key in the exports object like this:

export default { imagedraw: ImageDrawComponent, Header: HeaderComponent, };

SorooshGb avatar Jul 11 '24 05:07 SorooshGb