React · Middle · Question 60 of 75

How do you avoid many boolean flags like isSending, isSent, isError at once?

Explanation

Separate booleans allow impossible combinations (sending and sent at once). A single status variable - or a reducer - makes states explicit.

Further reading

Problem with a question

React · Middle · question 60

Test yourself

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

Take this quiz