DEV Community

Discussion on: How to Build a Skeleton Layout in React

Collapse
 
degesis profile image
PovilasB

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:
kentcdodds.com/blog/stop-using-isl...

Collapse
 
xavierbrinonecs profile image
Xavier Brinon

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

Collapse
 
james_baxter_9deedb25c4e6 profile image
James Baxter

I wish people would stop quoting Kent C Dodds.

Collapse
 
iridiumcodes profile image
Iris Diakoumi

Why is that?

Collapse
 
lukekyl profile image
Kyle Luke

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

Collapse
 
nikitaneganov profile image
NikitaNeganov

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