This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-03
Channels
- # boot-dev (1)
- # cider (27)
- # cljsjs (6)
- # cljsrn (11)
- # clojure (249)
- # clojure-dusseldorf (1)
- # clojure-finland (1)
- # clojure-greece (1)
- # clojure-italy (28)
- # clojure-nl (12)
- # clojure-russia (2)
- # clojure-spec (5)
- # clojure-uk (27)
- # clojurescript (24)
- # clojutre (2)
- # component (8)
- # cryogen (1)
- # cursive (7)
- # datomic (61)
- # editors (18)
- # emacs (1)
- # events (1)
- # figwheel (4)
- # fulcro (35)
- # graphql (4)
- # jobs (3)
- # jobs-rus (1)
- # keechma (1)
- # leiningen (1)
- # london-clojurians (1)
- # luminus (62)
- # off-topic (154)
- # onyx (23)
- # pedestal (43)
- # portkey (66)
- # re-frame (49)
- # reagent (23)
- # shadow-cljs (92)
- # tools-deps (113)
- # uncomplicate (2)
Hi. In the ratom.cljs
file there is a make-reaction
function which returns an instance of Reaction type (->Reaction f nil true false nil nil nil nil)
, where f
is reagent render function. I can't see/understand how an referenced atom inside that f
render function causes the f
to execute (causing the rerender). In general add-watch function sets some function to execute when some atom changes. Based on this, i can only think that when creating a reaction the f
function should be parsed as list data structure, all atoms in it should be found and watches then set on those atoms indicating to execute that f
function when they change.
Just started a brand new Reagent project, lein new figwheel
=> add reagent and bump clojurescript to latest, and now I get this
seems it's trying to use reagent/reagent-dom from npm-deps, whereas I'd be happy if it just used cljsjs
managed to get it working by adding the latest react/react-dom packages. reagent 0.8.0 depends on 16.3.0-1, whereas it worked with 16.3.2-0
@tomaas Reagent catches all RAtom deref
calls during render and adds watches from components to the ratom
or watch from other ratom to another
the deref method uses dynamic var to keep track of the context
e.g.
(defn foo-component []
(if @a-ratom
[:h1 @b-ratom]
[:div @c-ratom]))
Reagent will only watch a-ratom, and then b or c depending on a state
got it! thanks a lot @juhoteperi!
Getting the following error when trying to upgrade from reagent .7 to .8
No such namespace: react, could not locate react.cljs, react.cljc, or JavaScript source providing "react"
Seems like it just cannot find react
browser
actually, may be a cache issue? https://clojurians.slack.com/archives/C0620C0C8/p1525208684000081
Yeah, looking into the cache
got it to build...all the cljsjs/*
deps needed to be upgraded
As mentioned in the guide: > Using Reagent with Cljsjs packages doesn't require changes, other than making sure you update Cljsjs React dependencies, if you have direct dependencies to them. Also, using other packages depending on Cljsjs/React could cause one to have old version.