DEV Community

Discussion on: How to Build a Skeleton Layout in React

degesis profile image

Great article! One tip tho - ditch the loading boolean state. There is more than loading/done states. Best approach is to have idle/loading/success/error states. More management is required but, it saves users from waiting despite API call has failed.

This article by Kent is great explanation why:

xavierbrinonecs profile image
Xavier Brinon

ahah, I was about to post this, well played.

james_baxter_9deedb25c4e6 profile image
James Baxter

I wish people would stop quoting Kent C Dodds.

iridiumcodes profile image
Iris Diakoumi

Why is that?

lukekyl profile image
Kyle Luke Author

Great tip, I will look into this article! Thanks a ton!!!

nikitaneganov profile image

Actually, his (Kent's) initial structure is not that bad, in his specific case all he needed to do is a) clear position on error or b) move error check higher that position check, i.e. ensuring error's priority