Fork me on GitHub
#re-frame
<
2016-03-30
>
dvcrn01:03:11

Hi guys! I have a little problem with the rendering cycle (or so I guess). I have the following component:

(defn app-root []
  (let [logged-in? (subscribe [:logged-in?])]
    (if @logged-in?
      (fn []
        (println "Logged in:")
        (println @logged-in?)
        [logged-in-view])
      (fn []
        (println "Logged in:")
        (println @logged-in?)
        [login-view]))))
When logged-in? changes, the println triggers but reagent doesn't use the logged-inview. It keeps showing the login-view instead

dvcrn01:03:30

as in - I receive "Logged in: true" but don't see my view

dvcrn01:03:21

Gonna cross-post that in reagent simple_smile

mikethompson01:03:42

Answered in #C0620C0C8

vikeri11:03:11

@mikethompson: Ok great, I think the nested approach is cleaner then.