T
TanStack•2y ago
xenial-black

Basic Questions

Prefacing this with a note that I am new to front end development. Please excuse any terminology misuse. I have some general questions about the docs. For context using react. Take this example from the quickstart docs: https://tanstack.com/form/latest/docs/framework/react/quick-start 1. I notice in the quick start example a <form> tag is not used. But in the "simple" https://tanstack.com/form/latest/docs/framework/react/examples/simple example the tag is used, but the onSubmit element is being overriden to use the formApi hooks defined onSubmit function? Does that mean including <form> Is optional? 2. Where can I find the definition for form.Provider? 3. form.Field can only have a single child component it seems? What if I want a label as well for the input? 4. Given how basic these questions are above, I'm worried i'm not using the docs too well. Is there some sort of hello world tutorial that introduces the form elements one by one?
Quick Start | TanStack Query Docs
The bare minimum to get started with TanStack Form is to create a form and add a field. Keep in mind that this example does not include any validation or error handling... yet. `tsx
1 Reply
ambitious-aqua
ambitious-aqua•2y ago
1. <form> is technically optional, but you'll want to use it 100% of the time in web apps. It's optional because of React Native/etc 2. What do you mean by "definition"? TypeScript definition? 3. You'll use a JSX fragment: <React.Fragment> or <></> 4. Our docs are very early. You're not doing anything wrong - you're just very early 🙂

Did you find this page helpful?