I did the same. My hook's named useObjectState: The first two values of return array it's same like useState.. state and setState. I expect object as input (not intended for other data types).
The third one is spreadState - it spreads the new state object with the old one at first level of the object.
The fourth one is mergeState - that does a deep merge of the new state with the old one. Helps with nested states.
This way I am able to remain sane when dealing with large number of states. The use case is same as yours - for large form UIs.
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 did the same. My hook's named useObjectState: The first two values of return array it's same like useState.. state and setState. I expect object as input (not intended for other data types).
The third one is spreadState - it spreads the new state object with the old one at first level of the object.
The fourth one is mergeState - that does a deep merge of the new state with the old one. Helps with nested states.
This way I am able to remain sane when dealing with large number of states. The use case is same as yours - for large form UIs.