Passing form
all the way down - is there a better way?
#1701
Unanswered
alex-collibra
asked this question in
Q&A
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.
-
Let's say there is this components tree
For now I can't think of any good way to pass
form
fromTopLevelComponent
toFormPart1
without prop drilling.Should also wrap my
NestedComponent
withwithForm
and then passform
prop toFormPart1
which I should also wrap withwithForm
?Should I add
NestedComponent
,FormPart1
andFormPart2
toformComponents
and then do this?If I do it that way
form
type won't be picked up and it won't have neither ofNestedComponent
,FormPart1
etc.Because even if I use it this way I am still forced to pass form around in one way or another, which doesn't look like a clean solution. Am I missing something?
I checked examples but most of them have forms, which are only one level nested.
Beta Was this translation helpful? Give feedback.
All reactions