This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-15
Channels
- # announcements (5)
- # babashka (56)
- # beginners (24)
- # biff (15)
- # calva (7)
- # clj-kondo (12)
- # cljsrn (8)
- # clojure (68)
- # clojure-denmark (1)
- # clojure-europe (55)
- # clojure-norway (4)
- # clojure-spec (9)
- # clojure-uk (2)
- # clojurescript (8)
- # cursive (11)
- # data-science (7)
- # datahike (1)
- # datomic (66)
- # emacs (12)
- # etaoin (3)
- # fulcro (10)
- # graphql (3)
- # hyperfiddle (97)
- # jobs (1)
- # kaocha (8)
- # lsp (3)
- # malli (15)
- # meander (1)
- # off-topic (3)
- # overtone (4)
- # polylith (7)
- # rdf (25)
- # re-frame (4)
- # reagent (14)
- # remote-jobs (1)
- # shadow-cljs (126)
- # sql (30)
- # vscode (3)
- # xtdb (8)
Hi everyone, I'm switching my project from shadow-cljs+react-web to shadow-cjs+react-native+expo and I'm surprised to see that code changes to nested components don't get reflected on the UI. Said another way, consider the following reagent components hierarchy (https://github.com/galaux/reagent-expo-nested-components):
[root
[one
[two
[three]]]] ;; ← `three` is a simple `[:> rn/Text "hello"]
`
Changes in component three
are not reflected in the UI. Changes to root
, one
or two
are though. This is a stark difference with my previous react web setup where changes anywhere in the code were displayed right away.
Notice that the project looks OK regarding https://code.thheller.com/blog/shadow-cljs/2019/08/25/hot-reload-in-clojurescript.html (notably the use of [root {:x (js/Date.now)}]
).
thheller mentioned using shadow-cljs' config :devtools {:reload-strategy :full}
which seems to solve the problem. Also, https://stackoverflow.com/questions/74963979/why-does-updating-my-nested-reagent-component-not-update-it.
Could this be an expected react-native behavior and every shadow-cljs+react-native team is using this :reload-strategy :full
or am I missing something here?
Any advice would be welcome :)
Thanks!This would explain why one may need something like https://github.com/flexsurfer/rn-shadow-steroid ?
And I don't have {:x (js/Date.now)}
either, but the project isn't on the latest RN yet
Are you using https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/react_native.cljs to register the RN root? I think forceUpdate
SHOULD render the whole component tree.
I wouldn't recommended using old RN versions, there is billion problems with the RN tooling when you go to older versions
I'm not using shadow.react-native
but shadow.expo
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/expo.cljs#L9
But my problem doesn't look to be shadow-cljs related: when I open the generated app/index.js
the JavaScript there is correct (up to date) … just not rendered in the UI.
@U061V0GG2 how do you run expo? npx expo start
?
I don't use expo