modular-forms icon indicating copy to clipboard operation
modular-forms copied to clipboard

hello facing types errors

Open GolfredoPerezFernandez opened this issue 10 months ago • 1 comments

hello! i just remove all warnings by doing this but did not work

//<FieldLogin name="password"> {(field, props) => (

<input {...props} ref={loginPasswordRef} value={field.value} type="password" name="password" id="password" onChange$={onChangeHandler} onBlur$={onBlurHandler} class="bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-blue-500 focus:border-blue-500" placeholder="Password" /> {field.error &&
{field.error}
}
)} </FieldLogin>

i get in frontend

image

my original previous error was

Type '{ value: Maybe; type: "password"; name: string; id: string; class: string; placeholder: string; autoFocus: boolean; ref: QRL<(element: FieldElement) => void>; onInput$: QRL<...>; onChange$: QRL<...>; onBlur$: QRL<...>; }' is not assignable to type 'InputHTMLAttributes<HTMLInputElement>'. Types of property 'ref' are incompatible. Type 'QRL<(element: FieldElement) => void>' is not assignable to type 'Signal<Element | undefined> | ((el: Element) => void) | undefined'. Type 'QRL<(element: FieldElement) => void>' is not assignable to type '(el: Element) => void'. Types of parameters 'element' and 'el' are incompatible. Type 'Element' is not assignable to type 'FieldElement'. Type 'Element' is missing the following properties from type 'HTMLTextAreaElement': autocomplete, cols, defaultValue, dirName, and 152 more.ts(2322) (property) IntrinsicHTMLElements.input: InputHTMLAttributes<HTMLInputElement> and my original component <FieldLogin name="password"> {(field, props) => (

<input {...props} value={field.value} type="password" name="password" id="password" class="bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-blue-500 focus:border-blue-500" placeholder="Password" /> {field.error &&
{field.error}
}
)} </FieldLogin>

GolfredoPerezFernandez avatar Mar 31 '24 23:03 GolfredoPerezFernandez

Please send me a minimal reproduction on StackBlitz. Here is a template: https://stackblitz.com/edit/modular-forms-qwik?file=src/routes/login/index.tsx

fabian-hiller avatar Apr 01 '24 15:04 fabian-hiller