This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-21
Channels
- # admin-announcements (3)
- # beginners (15)
- # boot (96)
- # cider (5)
- # cljsjs (2)
- # cljsrn (3)
- # clojure (22)
- # clojure-austin (2)
- # clojure-russia (16)
- # clojured (2)
- # clojurescript (65)
- # css (4)
- # cursive (89)
- # datomic (7)
- # emacs (89)
- # events (1)
- # hoplon (126)
- # leiningen (2)
- # off-topic (2)
- # om (268)
- # onyx (19)
- # parinfer (42)
- # re-frame (5)
- # reagent (30)
- # yada (8)
Hey reframers, got a (probably) noob question: how can I use normal reagent atoms in my components? I’ve got a component that just needs to progress through a couple of steps (no submitting or validation, just hiding/showing HTML) and I’m trying to use this (standard?) reagent approach but it’s not working. Here’s my 10-line component - https://gist.github.com/heeton/df2faf7ab374e89ddf16 I can see that the atom is actually getting updated (if I log it afterwards, it has the new :stage2 value), but my view isn’t updating.
I assume I need to use a reaction somewhere? But I haven’t been able to work out where
Hey @heeton your component should be a form-2 component as explained in https://github.com/Day8/re-frame/wiki/Creating-Reagent-Components#form-2--a-function-returning-a-function. You basically need to return a fn that closes over the let
bindings and will return your div when called