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 ?
I haven't needed :reload-strategy :full
And I don't have {:x (js/Date.now)} either, but the project isn't on the latest RN yet
Good to know …
I could try downgrading the RN version to see if there's any difference.
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
Which is supposed to do the same
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.
@juhoteperi how do you run expo? npx expo start?
I don't use expo
Ok !