modular-forms
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)]
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
}
}
Yes. I think that the onSubmit
prop and children
are required.
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
Yes, maybe I should add an info to the docs.