Fork me on GitHub
#reagent
<
2018-01-11
>
mikerod00:01:26

Yeah, I’d think so. Also, it is more compatible. That’s a lot of upside, but you’d expect the tradeoffs as you say.

ajs03:01:55

is it acceptable to swap an ratom from outside a component function? i.e. if info comes in from a socket, swap it right into app state?

gadfly36107:01:27

@ajs yeah, i think so

oliy14:01:09

quick question all - i have a vanilla hiccup form e.g [:div "Loading..."] that I need to turn into an html string to give to a library i'm using - is there anything in reagent to do this? (i followed render down but it only seems to render it into a dom root)

oliy14:01:42

i use the component in other places in my app so would like to avoid having a string version and a hiccup version

juhoteperi14:01:55

@oliy reagent.dom.server/render-to-string, though note that is is relatively heavy way to compile hiccup as this will load React-dom/server

juhoteperi15:01:26

Depending on what your are trying do to, integration with some non-React libs is possible even with, reagent.core/render, I recently used this with Leaflet custom Controls.

oliy15:01:37

@juhoteperi kiitos paljon that's perfect, i only need to do this once. unfortunately the library only accepts a string, because it does some sort of frankenstein string/replace on it

juhoteperi15:01:01

@oliy If the app already uses Reagent, reagent.dom.server is probably fine, if not, you could look into Hiccups which implements this without React

oliy15:01:36

yeah it's a full blown reagent app already, i wanted to avoid pulling in another library just for this one little thing!

mikerod15:01:53

@oliy Perhaps you could use a more React-friendly library instead of one that is doing string mashing?

mikerod15:01:18

😛 I realize that there are times when that isn’t a choice.

oliy17:01:31

we're pretty invested in this one @mikerod! it's just for a tiny loading indicator, nothing major

mikerod17:01:40

@oliy Yeah, I thought perhaps that was the case