MicheleBertoli/react-worker

Refreshing: counter resets?

Closed this issue · 1 comments

I just checked this in Chrome/Mac and Chrome/Android, when I press the button (counter) a few times and press refresh, the number resets to 0?

I thought the service worker caches the number of clicks?

Hello @nicolechung, thanks for your question.
We are caching the initial response (the rendered components), not the component's state.
That's why the value of the counter always starts from zero.