Relative Content

Tag Archive for javascriptreactjsperformanceevent-handlingconflict

Why isn’t my optimistic UI updating immediately

I’ve got this React component where I’m testing out useOptimistic to simulate an optimistic UI update. The tricky part is, I don’t have a real backend, so I’m using a mock data source (messagesOnApi) from another module. I load that data into a local state variable (messagesRetrievedFromApi) and pass it into useOptimistic.