DEV Community

[Comment from a deleted post]
Collapse
 
iquirino profile image
Igor Quirino

JSON.stringify(data) will add extra processing...
Why not to just add a counter (setState(0)) and then increment it when object get changed?

Collapse
 
stephane profile image
Stephane Rangaya

How would you do this?

Collapse
 
nicklaswinger profile image
Nicklas Pouey-Winger • Edited

I assume by calling setLoadCount((prevState) => prevState + 1) or something like that :)

 
iquirino profile image
Igor Quirino
Collapse
 
neehachoudhary profile image
NeehaChoudhary

Created an account to actually thank you for this! :D