This is a silly example. Let's say I have 2 items in the form (gender and age). If age > 18 then gender should be boy else gender should be a girl.
If I change the age by inputting a new value to the number input, everything works as expected. However, if I change the age by clicking on the button, my app does not work. Could you guys help me on this? I would like the gender is updated as well when clicking on the button
https://codesandbox.io/s/upbeat-montalcini-wlt61?file=/src/App.js
Steps to reproduce
Click on button
What is expected? Age is changed to 25, gender is changed to Boy
What is actually happening? Age is changed to 25, gender is not changed