TanStackT
TanStack6mo ago
9 replies
foolish-indigo

does the name is fixed to "form"?..

trying this
  const form1 = useForm({
    ...
  })

  const form2 = useForm({
    ...
  })
  
  return <>
      <form1>
        ... 
      </form1>
      <form2>
       ... 
      </form2>
      </>

will give this TS error:
Property 'form1' does not exist on type 'JSX.IntrinsicElements'. (ts 2339)


Am I missing something, or we cannot use two separate forms in one component??
Because that what I think I need.

I have two tabs: "draft" and "published". The content is really similar, but the validation logic and submit actions are different, so I wanted to define just two useForm hooks, but apparently I can't...
Was this page helpful?