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

In SolidJS, getting Type '{}' is missing the following properties from type 'Omit<FormProps<NamespaceForm, undefined>, "of">': onSubmit, childrents [ts(2322)]

Open sparkling opened this issue 1 year ago • 3 comments

Type '{}' is not assignable to type 'IntrinsicAttributes & Omit<FormProps<NamespaceForm, undefined>, "of">'.
  Type '{}' is missing the following properties from type 'Omit<FormProps<NamespaceForm, undefined>, "of">': onSubmit, childrents(2322
type NamespaceForm = {
alias: string;
uri: string;
}

const Namespaces: Component = () => {
const [, Namespace] = createForm<NamespaceForm>();
return  <Namespace.Form/> //ERROR HERE
};

export default Namespaces;

Do you know what's going wrong here?

tsconfig:

{
  "compilerOptions": {
    "strict": true,
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "node",
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "jsx": "preserve",
    "jsxImportSource": "solid-js",
    "types": ["vite/client"],
    "noEmit": true,
    "isolatedModules": true
  }
}

sparkling avatar Sep 18 '23 14:09 sparkling

Yes. I think that the onSubmit prop and children are required.

fabian-hiller avatar Sep 19 '23 02:09 fabian-hiller

Cool, thanks!

I was following your tutorial here: https://modularforms.dev/solid/guides/create-your-form

Perhaps you should add something about the above here?

Thanks for the quick reply

sparkling avatar Sep 19 '23 14:09 sparkling

Yes, maybe I should add an info to the docs.

fabian-hiller avatar Sep 19 '23 22:09 fabian-hiller