State Management · Junior · Question 52 of 75

When should two pieces of state be combined into one object?

Explanation

Grouping related values avoids forgetting to update one of them. Unrelated values are simpler as separate useState calls.

Further reading

Problem with a question

State Management · Junior · question 52

Test yourself

Take the State Management · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz