-
Hi there, I have a question regarding the usage of useForm. I used to abstract away the form into ints own component which in there defines the useForm(). However most of the time the parent page level component are also interested in the formstate. What is the best way for parent to subscribe to formstate without having the define useForm on the parent level (I think this one kind of violates single responsibility) thanks! :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
To address your concern about subscribing to state inside a child component from the parent, I don't think it's ideal. |
Beta Was this translation helpful? Give feedback.
You can decouple the buttons header into it's own reusable component, but for both HTML semantics and the React rendering cycle it would still make sense to call
useForm
high enough in the parent tree to provide the value subscription to both the form and actions components.