tsedio / tsed-formio

Repository dedicated to formiojs.
https://formio.tsed.io
14 stars 8 forks source link

[QUESTION] Custom component in Typescript #138

Open frances-datacom opened 3 months ago

frances-datacom commented 3 months ago

Hi,

My apologies, I know that I sound like a broken record at the moment. Typescript is giving me grief! 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

Romakita commented 3 months ago

Hi @frances-datacom

I think your issue isn't related to typescript itself ;). Js example for formio is the same for TypeScript (like is it for your previous issue), so don't complain about TypeScript :p

I'm not able to help you. You issue seems to be directly related to Formio.io API and how you use it to register your custom component. If you have the original formio.js code example, maybe I can help you. But for specific question like that, it should be better to ask Formio team. @tsed/react-formio is just a react wrapper around the formio.js, all options given to FormBuilder component are directly given to his formio.js equivalent.

See you

frances-datacom commented 3 months ago

@Romakita Thank you for your help. I was thinking that this was the appropriate place since this library adds in Typescript compatibility for formio/react :) I'll ask my question on formio.js.