Hacker News new | ask | show | jobs
by bgdam 2686 days ago
I think this is because you are using both state and props to manage the values of fields. I generally tend to use only props, with an onChange handler passed in from the parent component. This way, I can always have an up to date mapping of field names to values in the parent component, while simplifying state management in the child.
1 comments

This is exactly what I’m saying: use only props and handle state elsewhere.