"Nested" Forms #1458
Unanswered
michaelcamper
asked this question in
Q&A
"Nested" Forms
#1458
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a
TaskFormwith a pretty complex UI. I either want to use this form standalone (to create a new task or add an existing task) or insideTaskListcomponent that allows to add and edit a list of tasks.Therefore, I want to
useForminTaskListand somehow pass aformto all theTaskForms inside the list.Here is my best attempt to achieve this:
Here's another approach that worked, but is a TS mess:
TaskList] Wrap thetasksFieldinside<taskFormContext.Provider value={form}>...</taskFormContext.Provider>TaskForm] Add an optionalprefixprop and prepend the field namesTaskForm] ReplaceuseTaskFormwithuseTaskFormContextBeta Was this translation helpful? Give feedback.
All reactions