Fork me on GitHub
#shadow-cljs
<
2018-07-07
>
urbanslug21:07:30

I'm trying to call a default export from an npm module

lilactown22:07:30

depending on how react-d3-speedometer is implemented. if it’s using ES module syntax (import/export), then you can do: (:require ["react-d3-speedometer" :default d3-speedometer) and use it like [:> d3-speedometer]

👍 4
urbanslug21:07:59

problem is I can't figure out how to call the default export as a react component in reagent

urbanslug21:07:12

(:require ["react-d3-speedometer" :as s])

(defn x
  []
  [:> ...how to call default export of s?]

jjttjj22:07:14

hi everyone, sorry I'm not 100% sure this is shadow specific but I just started messing around with raw react, anyone know why (react/createElement "h1" nil #js["hello world"] ) seems to return nil at the repl, but when i js/console.log it I get a react element value?