Fork me on GitHub
Pablo Fernandez14:08:21

Is there a way to convert a reagent component [:like "this"] to a node I can pass to appendChild?


@pupeno Not cleanly, but you could use reagent.dom.server/render-to-string and call document.createElement with that


e.g is probably much better fit for this as you don't really need React for anything in this case

Pablo Fernandez15:08:01

@juhoteperi I need react and I wouldn't use hiccups as it's prone to XSS.

Pablo Fernandez15:08:38

Ah... that might be a different Hiccup.


No React features will work if you render React component somehow and put that to DOM using appendChild

Pablo Fernandez15:08:27

I'm creating a custom class, but I get your point.


Maybe you want to use reagent/as-element instead? That will return native React element you can pass to other components