useReducer with 50 cases? Custom hook is a solution, but its development is more difficult for developers. Who don't understand this, cannot design it. I already imagine a ton of terrible code from juniors in Internet... IMO
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I see your new code with hooks for 2 fields and it looks awkward... If you have 50 fields?
Then you either use your custom hook combining the relevant fields, or use useReducer.
useReducer with 50 cases? Custom hook is a solution, but its development is more difficult for developers. Who don't understand
this
, cannot design it. I already imagine a ton of terrible code from juniors in Internet... IMO