This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-19
Channels
- # announcements (2)
- # beginners (12)
- # cider (12)
- # cljsrn (1)
- # clojure (56)
- # clojure-italy (1)
- # clojure-sweden (2)
- # clojure-uk (3)
- # clojured (6)
- # clojurescript (16)
- # cursive (1)
- # data-science (3)
- # datomic (8)
- # emacs (18)
- # figwheel-main (1)
- # graphql (5)
- # jobs (10)
- # luminus (4)
- # nrepl (27)
- # off-topic (5)
- # pathom (7)
- # shadow-cljs (66)
- # sql (40)
- # tools-deps (1)
- # vim (6)
Hi, I want to fetch data from server every time I render view, I found that React Native lifecycle event getDerivedStateFromProps runs right before every call of render function, I've tried to write simple call of this event but I got an error:
Warning: %s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method., reagent1
- node_modules\react-native\Libraries\YellowBox\YellowBox.js:59:8 in error
- node_modules\expo\build\environment\muteWarnings.fx.js:27:24 in error
- ... 22 more stack frames from framework internals
My code is:
(defn warehouses-screen []
(r/create-class
{:reagent-render
(let [warehouses (rf/subscribe [:warehouses])]
(fn [props]
[c/view {:style []}
...
]))
:get-derived-state-from-props
(fn [this nextProps nextState] (prn "!!!getDerivedStateFromProps!!!" ))}))
How can I declare a static method?