I don't quite see the point of having this. setState method already updates the state. Also, I think you should actually split your object in three useState hook calls. To be honest, I'm still learning about Hooks API but that's what I understand so far by seeing examples of hooks usage.
I don't quite see the point of having this.
setState
method already updates the state. Also, I think you should actually split your object in threeuseState
hook calls. To be honest, I'm still learning about Hooks API but that's what I understand so far by seeing examples of hooks usage.There is no batching for setState calls yet. My suggestion may solve this problem.