This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-22
Channels
- # 100-days-of-code (3)
- # announcements (7)
- # beginners (147)
- # cider (22)
- # cljdoc (24)
- # cljs-dev (71)
- # cljsrn (8)
- # clojars (3)
- # clojure (45)
- # clojure-conj (11)
- # clojure-dev (1)
- # clojure-italy (21)
- # clojure-nl (2)
- # clojure-spec (76)
- # clojure-sweden (2)
- # clojure-uk (100)
- # clojurebridge (3)
- # clojurescript (15)
- # cursive (7)
- # data-science (2)
- # datomic (7)
- # emacs (9)
- # events (2)
- # figwheel-main (4)
- # fulcro (117)
- # jobs (2)
- # jobs-discuss (21)
- # leiningen (184)
- # nyc (4)
- # off-topic (50)
- # planck (6)
- # re-frame (14)
- # reagent (25)
- # ring-swagger (5)
- # shadow-cljs (96)
- # spacemacs (5)
- # sql (26)
- # tools-deps (12)
- # uncomplicate (1)
- # yada (3)
So I’m trying to work with apollo client in cljs, and they seems to be using function-as-a-child-component pattern. I can’t seem to figure out how to recreate this in reagent. Passing a function as a child simply results in an error about functions not being valid children. Anyone get this kind of thing to work before? (below is the apollo example)
pre-existing React application?
I'm not expert, but I don't see why not. Reagent doesn't "take over" the whole page, it just renders components using React. the one thing I'm aware of that requires care is that you need to use reagent/atom
so it can track changes and rerender components that need it.
reagent probably needs to be in control of an entire dom element. i.e, at some point you have to call (r/render [my-component] some-js-dom-element)
I see I see, thanks! Would my method of building the JS stay the same IE lein cljsbuild
?
yeah, it's always going to be faster than using JS, even if you're careful.
perhaps "more consistently smooth" is a better phrasing than "faster"; JS animations are great until a JSON blob arrives and you drop a couple frames, or whatever.
either way, grease up, because every path to animation entails great suffering.
@braden.shepherdson, @polymeris thanks, but how would I go about an unmount animation, using css?
@artur you need to get the npm module imported, either by using shadow-cljs or by using the webpack method, then you need to read this: https://github.com/reagent-project/reagent/blob/master/doc/InteropWithReact.md
I applied shadow-cljs to myu project and it seems to work just fine, except for hot reload. It does watch my changes and recompiles but in my browser the changes are not visible and refresh also doesn't bring changes.
@bravilogy react-spring seems pretty cool but I haven’t used any of them. there are a lot of choices out there, which tells me the problem isn’t really “solved” https://github.com/drcmda/react-spring/tree/master/examples