← Back to context

Comment by jnnnthnn

1 year ago

Snap! I can't repro this. Which browser are you using?

Firefox (on linux). But it seems to also happen in Chrome. I took a quick screen capture: https://imgur.com/a/jpPtj2f - you can see when I click back, the button shows the spinning icon.

  • Thanks! I couldn't see it on Chrome due to React Devtools interference.

    Turns out the page was ending up in bfcache (https://web.dev/articles/bfcache), which in turn led to the button's loading state being preserved when clicking back. Listening to the `pageshow` event enables one to handle that somewhat gracefully.