Nice article and well explained! If you want to go further with the hook I always recommend this article of Kent C Dodds about not using booleans for loading
Yes, that is also a good approach. But, if I am using reducers, I just go with states as reducers help us updating states synchronously.
Reducers can also be useful when the different states are closely related, although both options are good in this case :)
Some comments have been hidden by the post's author - find out more
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
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.
Nice article and well explained! If you want to go further with the hook I always recommend this article of Kent C Dodds about not using booleans for loading
Yes, that is also a good approach. But, if I am using reducers, I just go with states as reducers help us updating states synchronously.
Reducers can also be useful when the different states are closely related, although both options are good in this case :)