Fork me on GitHub

But i really dont understand why not (defn component [db] [:div @(subscribe db [:sub])])


It Will turn every component stateless, purely funcional and easy testable/mockable


For one it’s nice to be able te re-load everything but the state when developing.


And you still can make purely functional components, if you want. For example I have some input components, that only have a local atom, and do a dispatch when certain conditions are met.


Is there a way to access, from within a re-frame view function, the corresponding DOM element? I mean, other than through event handlers like onClick? I'm trying to have a view react to a state change by scrolling itself into position, perhaps with scrollIntoView. Can't tell if I'm trying to invent an antipattern or just missing something obvious...


@curlyfry Yes, that's exactly what I needed! Still not sure I'm going to shoot myself in the foot or not though. Does using a ref callback for the purpose of scrolling an element sound like a bad approach to you?


@fahey Sounds like a good approach to me! Try it out and see what it feels like :)


@curlyfry Ok, I will. Thanks for your help!