Not assignable type React, Typescript, Hilla

65 Views Asked by At

I try to set the colspan of a textfield like in the documentation of Hilla. https://hilla.dev/docs/react/components/form-layout

<FormLayout
  responsiveSteps={[
    // Use one column by default
    { minWidth: 0, columns: 1 },
    // Use two columns, if layout's width exceeds 500px
    { minWidth: "500px", columns: 2 },
  ]}
>
  <TextField label="First name"></TextField>
  <TextField label="Last name"></TextField>
  <TextField label="Username" colspan="2"></TextField>
  <PasswordField label="Password"></PasswordField>
  <PasswordField label="Confirm password"></PasswordField>
</FormLayout>

I got an error on colspan. With colspan={"2"} or colsSpan={"2"} I got the expected result, but still got this error

[TypeScript] Type '{ colspan: string; label: string; }' is not assignable to type 'IntrinsicAttributes & Partial<Omit<Partial<{ defaultChecked?: boolean | undefined;

Can someone explain this to me? Sorry I am new to the frontend (Js & Typescript)

0

There are 0 best solutions below