tinyplex / tinybase

The reactive data store for local‑first apps.
https://tinybase.org
MIT License
3.23k stars 65 forks source link

vite-tinybase-react stopped working with React.StrictMode since version 3.4.22 #106

Closed feychenie closed 8 months ago

feychenie commented 8 months ago

Describe the bug

When using the vite-tinybase-react starter -which is using 4.3.10- and wrapping the <App /> with <StrictMode>, the UI responds to interactions. When upgrading tinybase to latest 4.3.23, the UI stops responding.

I narrowed down the break at version 4.3.22, version 4.3.21 still works.

Your Example Website or App

https://stackblitz.com/~/github.com/feychenie/tinybase-strict-mode-issue

Steps to Reproduce the Bug or Issue

  1. install the vite-tinybase-react example npx degit tinyplex/vite-tinybase-react my-tinybase-app
  2. install the dependancies
  3. check in package-lock.json that tinybase is at version 4.3.10
  4. in index.jsx, wrap <App /> with <StrictMode>
  5. run the app, everything should be working fine
  6. update tinybase to 4.3.22
  7. run the app, the UI is now unresponsive to interactions
  8. downgrade to 4.3.21, the UI is now responsive again (make sure to lock the version)

Repro repo:

Expected behavior

No response

Screenshots or Videos

No response

Platform

Additional context

No response

jamesgpearce commented 8 months ago

OK I can look into this. Thanks for the report!

jamesgpearce commented 8 months ago

Fixed in 4.3.24 and the vite templates have been updated too (and include StrictMode by default so if this regresses we'll know quickly!)

feychenie commented 8 months ago

Amazing, thanks a lot!