This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-14
Channels
- # aleph (2)
- # atlanta-clojurians (5)
- # beginners (38)
- # boot (2)
- # bristol-clojurians (1)
- # cider (31)
- # clara (8)
- # cljs-dev (136)
- # cljsrn (4)
- # clojure (86)
- # clojure-china (1)
- # clojure-greece (1)
- # clojure-italy (24)
- # clojure-nl (1)
- # clojure-spec (21)
- # clojure-uk (19)
- # clojurescript (68)
- # community-development (28)
- # core-async (35)
- # core-logic (4)
- # cursive (1)
- # data-science (1)
- # datascript (1)
- # datomic (46)
- # events (1)
- # figwheel (6)
- # fulcro (11)
- # graphql (3)
- # hoplon (1)
- # jobs (6)
- # jobs-discuss (94)
- # keechma (3)
- # luminus (4)
- # lumo (7)
- # mount (6)
- # off-topic (24)
- # onyx (6)
- # parinfer (31)
- # portkey (3)
- # programming-beginners (16)
- # re-frame (20)
- # reagent (69)
- # remote-jobs (4)
- # ring-swagger (25)
- # schema (1)
- # shadow-cljs (151)
- # spacemacs (2)
- # sql (14)
- # tools-deps (16)
- # uncomplicate (5)
- # unrepl (35)
- # vim (1)
- # yada (72)
anyone using react-sticky with reagent? I’ve been trying to use the cljsjs version(s) to no avail. I found some stuff in the archive from @gadfly361 that led me to try downgrading from the 6.x version to 5.x but still no joy. after requiring cljsjs.react-sticky
the js/ReactSticky ref is nil
@eoliphant either (1) include the UMD build with a script tag and then references the global object, (2) use :foreign-libs
, (3) consider using shadow-cljs
, where you can just install it via yarn/npm and include it
ok justin will give that a shot. Been wanting to switch to shadow, but it’s was kind of a pain trying to get it all workiing with my current project’s setup..
here were my notes-to-self when I was figuring all of this stuff out. it probably isn’t really all correct but it might help https://gist.github.com/jmlsf/f41b46c43a31224f46a41b361356f04d
if you already have a lein project, i believe you can just let lein do dependencies and just embed shadow in lein
i forgot the guy’s handle, the shadow author, he was helpful, but it was still a pain to get it working. need to do some refactoring on my project.clj
so if you don’t want to go with shadow right now, I still think the the best route is to setup :foreign-libs and then do all your accesses with cljs-oops. One thing to investigate: you might not even really need to use cljs-oops if you turn on externs inference and make sure to turn on warnings and then type hint. My understanding is that shadow does this in a bette way.
and of course in terms of actual reagent interop: https://github.com/reagent-project/reagent/blob/master/docs/InteropWithReact.md
yeah, i’d been reading that. I’m hoping one day, this all makes it into the native builder. I love clojure(script) but this stuff is a pain lol.
I saw the 1.10 beta was out, wasn’t clear from the docs that are available how much, any of this stuff has been improved
hey so one thing. I’m under a time crunch so just gonna do whatever works fastest lol. So, my project is reagent, etc via cljsjs
i guess there’s a chicken/egg issue since reagent and all gets wrapped up into my app.js
i think that’s fine. if react and reagent is all working and you just want to add in react-sticky, just <script> include the UMD build
@eoliphant I am using react sticky with reagent 6.1 and react 15.4 and it is working for me
[Rebel readline] Type :repl/help for online help info
To quit, type: :cljs/quit
app:cljs.user=> (require '[cljsjs.react-sticky])
app:cljs.user=> js/ReactSticky
nil
app:cljs.user=>
(i dont remember what I said regardning this topic 😆 )
;; in project.clj
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.456"]
[reagent "0.6.1" :exclusions [[cljsjs/react-dom]
[cljsjs/react]]]
[cljsjs/react "15.4.0-0"]
[cljsjs/react-dom "15.4.0-0"]
[cljsjs/react-sticky "5.0.8-0"
:exclusions [[cljsjs/react-dom]
[cljsjs/react]]]
(ns foo.bar
(:require
[cljsjs.react-sticky]
...)
(def sticky-container (reagent/adapt-react-class (aget js/ReactSticky "StickyContainer")))
(def sticky (reagent/adapt-react-class (aget js/ReactSticky "Sticky")))
@eoliphant what exactly isn’t working?
have you looked at the top of whatever file you are including via foreign-libs to make sure it is actually a UMD build?
cljsjs is frustrating because there are so many layers I don’t know what it is doing
@eoliphant for completeness, have you killed and restarted figwheel ? (Rather than reload-config)