Fork me on GitHub
#reagent
<
2021-09-24
>
Thomas Meier02:09:15

Hi, I'm trying out interop with React. I am trying to use this https://github.com/rcdexta/react-trello have included it with (:require ["react-trello" :as rt]) and then using it in hiccup like [rt/Board ...] but that says it is undefined. I've also tried [:> rt/Board and :r>. Both say undefined. I tried using :refer [Board] instead with the same result. I'm not sure how to handle this case.

lsenjov02:09:53

Using shadow-cljs ?

lsenjov02:09:44

Also, in a cljs repl, can you see the value of rt or rt/Board /

Thomas Meier02:09:49

Yes on shadow-cljs

Thomas Meier02:09:37

rt is a #js object, Board is undefined.

p-himik06:09:15

rt probably is Board. If it looks like a component, use :as Board. If it has a default field, use :default Board. In any case, you can use this table, but make sure to read the whole section since there can be subtleties: https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages

👍 1