Fork me on GitHub
James Pratt10:09:25

A beginner question. I am stumped as to why the DOM is not updating when I add to values in a collection in an atom. My code: See it in action on github pages: In the console I can see that the samples atom is being updated but the DOM is not changed. Can someone see what I am overlooking?

✅ 1

Turn that [:div ...] into a proper component, within its own function.

James Pratt10:09:23

Oh! Thanks, will give that a go


Yes, rdom/render parameter is a bit special. Reagent can't register RAtom change listeners to any component in this case, so you need a component.

👍 1
James Pratt11:09:57

Thanks guys! That fixed my problem and the vega-lite components are updating beautifully too. :smiling_face_with_3_hearts:

👍 1

Hey all (esp @gadfly361), updated my deps to new versions and spending today tracking down new console warnings for non-reactive use of subscribe.. I think I’ve tracked down a bunch to re-pressed/impl.cljs .. is this something to worry about? I think the warning is more for using subscribe in js event handlers, but I just want to be double sure. Thanks!


@rdonahue thanks for the heads up! re-pressed was written before re-frame put those warnings in. If you or anyone reading this thread is interested in submitting a PR to refactor, I would be happy to review.

👍 1

Another question.. working with a JS interop component (PrimeReact kit) and its SplitterPanel seems to want a rendered component.. I'm passing a fn that resolves a component but if I wrap with [:div (get-panel panel)] it returns arity 0 errors.. how do I render the [:div ...] ?


Can you provide the relevant CLJS code, an example JS code, and a full stack trace of that error?


I think I just got it sorted out, that particular part of the code was like some of the first 'working' cljs I ever wrote and its solidly in the 'I have no idea how it ever worked' category.. subscriptions all in wrong places, wrong component forms being used.. totally refactored it and its now behaving normally.