DEV Community

Discussion on: What is the standard way to keep UI state and backend state synced during updates? (React and Node)

Collapse
 
ezemans profile image
Ezequiel Mansilla

"On UI side, I do the update first, then send the updates to backend". This is the right way.

Collapse
 
lennythedev profile image
Lenmor Ld

I'm starting to see this very often, and recently learned that it's called "optimistic rendering/UI updates"

Definitely a pattern to explore

Collapse
 
jesseayegba profile image
JesseAyegba

What if the request never gets to the backend? How do you deal with that? It means that your UI is now in a wrong state.

Collapse
 
yifeikong profile image
Yifei Kong

I suppose that would be a timeout error?