reagent

A minimalistic ClojureScript interface to React.js http://reagent-project.github.io/
wombawomba 2020-10-25T14:57:28.090800Z

So Iā€™m trying to render a react-based JS lib in my Reagent app. Unfortunately said JS lib expects to be passed a DOM element to which it can render itself. How can I build a Reagent component that handles this?

simongray 2020-10-25T15:32:58.090900Z

You can use the :ref attribute to capture a reference to the DOM element once the component has been added to the DOM. Then you can either do something with it immediately or store it in a r/atom. https://github.com/reagent-project/reagent/blob/master/doc/FAQ/UsingRefs.md

wombawomba 2020-10-25T15:33:24.091300Z

Cool, thanks šŸ™‚

simongray 2020-10-25T15:34:50.091500Z

No problem. šŸ™‚ :ref is really useful.