This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-12
Channels
- # architecture (17)
- # babashka (13)
- # beginners (12)
- # calva (1)
- # cider (7)
- # clojure-bay-area (15)
- # clojure-europe (4)
- # clojure-norway (7)
- # datomic (7)
- # gratitude (5)
- # honeysql (7)
- # hyperfiddle (2)
- # introduce-yourself (4)
- # jobs-discuss (13)
- # juxt (2)
- # lsp (3)
- # malli (7)
- # practicalli (17)
- # rdf (8)
- # re-frame (9)
- # releases (1)
- # shadow-cljs (24)
- # spacemacs (15)
I am getting
WARN re-frame: Subscribe was called outside of a reactive context.`` and I am not sure why.
I have this code:
(defn render-friend
[friend]
(let [name (:name friend)
id (:id friend)]
[:> rn/Text {:key id :style {:font-weight :normal
:font-size 16
:color :blue}}
name]))
(defn friends-list
[]
(let [friends @(subscribe [:friends])]
[:> rn/ScrollView (map render-friend friends)]))
(defn main-view
[]
[:> rn/View {:style {:background-color :white
:flex 1}}
[:> rn/View {:style {:flex 1}}
[:> MapView]]
[:> AnimatedBlock
(friends-list)]])
Animated block is a pure JS component that takes children as its only prop. It does complicated layout/styling stuff so it was easier to copy paste examples in JS.Are you sure it comes from this particular subscribe
call?
Also, you probably shouldn't be calling (friends-list)
like that. Try [friends-list]
instead.