Fork me on GitHub
#reagent
<
2017-11-03
>
tatut07:11:12

there’s a function called reactify-component in reagent.core that says it does just that

tatut07:11:25

haven’t tried it

pesterhazy09:11:40

@kishanov yes it's very easy, like @tatut said

pesterhazy09:11:46

remember that a React (functional) component is just a function that returns a React element

pesterhazy09:11:50

so you could also easily export a clojurescript function that returns (r/as-element [:div "or any other Reagent hiccup"])

pesterhazy09:11:21

cljs functions are just js functions, so you can use it from your JS React code

mikerod14:11:49

Perhaps the “Simple React integration” section is helpful to you

mikerod14:11:07

woops, this has already been answered. I didn’t see it some reason 😛

kishanov14:11:16

Thanks folks, it worked!

pwrflx15:11:50

hi! there is something strange going on in one of the libraries I use. Is there some way of debugging what's going on in that particular function? I've tried to use the debugger of cider, but it did not stop, so I guess the function was not properly reloaded..

p-himik16:11:04

@pwrflx You can always use (js-debugger)

pwrflx16:11:34

I'll give it a try, thx

mikethompson18:11:58

@pwrflx dirac may be a help? Althought some effort required to set it up.