Fork me on GitHub
#reagent
<
2018-08-24
>
urbanslug15:08:46

I'm tryuing to call map-component as a child of another but it won't render I assume it needs a r/render but I don't have a DOM node to put it in so I don't want to r/render. Ideas on how I can get around this?

(require ["react-leaflet" :refer (Map Marker Popup TileLayer)])

(defn map-component
  []
   [:> Map {:center [51.505, -0.09]
            :zoom 13}
    [:> TileLayer {:url url-template
                   :attribution attribution
                   :accessToken token
                   :id          <>}]
    [:> Marker {:position [51.505, -0.09]}
     [:> Popup "some text"]]])

urbanslug15:08:59

nvm it was there all along just too tiny

Michael Thurmond23:08:51

does anyone have a suggestion on a reagent library to use to create a sticky header?

Michael Thurmond23:08:13

simialr to react-sticky https://www.npmjs.com/package/react-sticky which I'm having trouble getting into my project

gadfly36123:08:32

@thurmondmb I use react-sticky itself and like it a lot. I go the cljsjs route 1) add [cljsjs/react-sticky "6.0.2-0"] to your project.clj dependencies 2) require [cljsjs.react-sticky] in your namespace Then

(def sticky-container (reagent/adapt-react-class (aget js/ReactSticky "StickyContainer")))
(def sticky (reagent/adapt-react-class (aget js/ReactSticky "Sticky")))
(And yes, I am still one of the sinners that uses aget instead of goog.object/get 😆 )