Fork me on GitHub
#reagent
<
2017-12-12
>
kurt-o-sys17:12:02

cross-posted from #clojurescript

kurt-o-sys17:12:46

In my namespace where I want to add the component:

(:require ...
            ["react-flatpickr" :as flatpickr]
 
No error, so it means it is somehow recongized. But now I'm stuck...

kurt-o-sys17:12:55

I can't seem to do anything with flatpickr

noisesmith17:12:50

why is react-flatpickr in a string?

kurt-o-sys17:12:02

because I saw it somewhere configured like that, and that's the closest I've become - no errors or warnings

mikerod17:12:22

@kurt-o-sys what are you trying to do with flatpickr

mikerod17:12:31

like what sort of usages of that symbol

kurt-o-sys17:12:31

import Flatpickr from 'react-flatpickr' and <Flatpickr /> for a start would be fine 🙂

noisesmith17:12:02

that <foo /> syntax will not work in cljs

kurt-o-sys17:12:15

sure not, I know that.

kurt-o-sys17:12:36

I want to make it work in cljs, so I tried to 'translate' these things to cljs, but I can't make it work.

kurt-o-sys17:12:51

So I followed that guide I mentioned earlier, but that doesn't work either.

kurt-o-sys17:12:58

as about any other guide I tried 😛

noisesmith18:12:13

so copying the example you shared (:require ["react-flatpickr" :refer [FlatPickr]) then use FlatPickr

kurt-o-sys18:12:30

right... thx, will try 🙂

noisesmith18:12:05

I’m not sure how the react syntax stuff translates though…

mikerod21:12:22

@kurt-o-sys @noisesmith so with the :as syntax perhaps it is

(def FlatPickr (r/adapt-react-class flatpickr/FlatPickr))
[FlatPickr]

mikerod21:12:33

well have to wrap it