Closed eyelidlessness closed 7 years ago
Hey, I'm having the same issue, thanks for your feedback ^^ Where do you put this function?
I realized you can just pass an RAtom
as the initial data, rather than a plain map. That's plenty good enough for me.
Actually, what about you don't want a full RAtom (such as app-db in reagent
+ re-frame
) but much more a reaction on it (just to get a part of it)?
Repro (minimal)
Expected
This will render
reagent.ratom/RAtom
.Observed
It renders
cljs.core/Atom
.More detail
Since Reagent uses
reagent.ratom/RAtom
to trigger re-render, a devcard with certain functionality may not re-render as expected.I experienced this problem with a Reagent component with a button that that called
(swap! state ...)
on click. I had:inspect-data true
on the card, the inspected state re-rendered, but the Reagent component in the card never did.Workaround
I really don't like this, but it's what I did to move forward on my project. Others might find it useful if they encounter the same problem: