cljsrn

dazld 2023-02-16T13:57:26.810859Z

I noticed a couple of people mentioning that they wrap components to get around a warning in react-navigation, something about an invalid component name. Iโ€™m not sure itโ€™s in the docs, but after digging around in reagentโ€™s code, I found that reagent will take a display-name meta attribute as an override for the name of the component, meaning we can specify SomethingValid` and avoid having to wrap components, or ignore warnings. Hereโ€™s an example:

(r/reactify-component (with-meta (fn name [{:keys [^js route]}]
                                   [component {:route (bean/->clj route)}])
                                 {:display-name display-name}))
hope this helps someone ๐Ÿ™Œ

๐ŸŽ‰ 3
hadils 2023-02-16T17:04:52.084829Z

Thank you @dazld! This is very helpful.

๐Ÿ‘ 1
2023-02-16T19:07:03.426199Z

This should be pinned! ๐Ÿ˜† I had to ignore those warnings (using logbox), thanks for sharing this!

๐Ÿ™Œ 1
dazld 2023-02-16T13:58:33.855919Z

on another topic - I canโ€™t figure out yet, how to make the navigator not lose state on reload - Iโ€™m using shadow. How do you all handle this?

โœ… 1
dazld 2023-02-16T15:58:04.938029Z

answering my own question.. missed the doc page which describes in detail how to do this ๐Ÿ™‚ https://reactnavigation.org/docs/state-persistence

dmitryn 2023-02-16T18:55:16.329689Z

hey, you already answered it, but i add link to similar question asked in this channel before https://clojurians.slack.com/archives/C0E1SN0NM/p1652439790706039?thread_ts=1652431961.516389&cid=C0E1SN0NM

๐Ÿ™Œ 1
dazld 2023-02-17T13:34:55.420599Z

ty @trybeee!