Open robodna opened 1 month ago
Does required<string>('Please enter your name.')
fix it?
It is the<Field>'
s child function that throws Typscript warnings:
field:FieldStore, props:FieldElementProps
I need more of your code or a reproduction on Stackblitz. What framework are you using?
I"m using SolidJS. Typescript does not like FieldStore or FieldElementProps as types. The both have an underline in red in VisualStudioCode. I just set them both to :any to hide the warnings.
Feel free to create a reproduction using this template: https://stackblitz.com/edit/modular-forms-solid?file=src%2Froutes%2Flogin.tsx
I'll have to investigate further since some components do not show the Typescript warning, but some do. It may have to do with the <Form element being in a separate component instead of in the same component as the <Field elements. I have a component to render the start of the <Form, and then another component which renders the <Field components.
I see a typescript warning on 'field' and 'props' for the following:
<Field name="owner" validate={required('Please enter your name.')}> {(field, props) => (
I tried setting to the following but still get an error:
field:FieldStore, props:FieldElementProps
What am I doing wrong?
Thanks