Closed JordanSkousen closed 1 year ago
Sorry. I didn't read the Using Refs documentation closely enough.
We use a normal Clojure atom because refs never change during the lifecycle of a component and if we used a reagent atom, it would cause an unnecessary re-render when the ref callback mutates the atom.
All I need to do is change from a reagent.core/atom
to a clojure.core/atom
and it's working.
What happened?
When dereferencing a React ref stored in a
reagent.core/atom
, the re-frame-10x panel stops updating - no events are displayed and the app-db does not update. It is still interactable, so it is not completely frozen. Interestingly, when switching tabs and coming back the panel updates upon switching, but continues to not update.Here's some sample code of a demoing this out. The
h1
uses reagent's ref feature, and toggling the checkbox will turn off/on dereferencing the ref to theh1
, which will toggle off/on breaking the 10x panel.10x Version
1.5.0
Reagent Version
1.1.1
React Version
18.2.0
re-frame Version
1.3.0
What browsers are you seeing the problem on?
Firefox, Chrome, Microsoft Edge
Relevant console output
No response