This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-07
Channels
- # architecture (35)
- # babashka (9)
- # beginners (31)
- # biff (15)
- # calva (8)
- # catalyst (3)
- # cider (7)
- # clerk (4)
- # clj-kondo (24)
- # clj-yaml (10)
- # clojure (58)
- # clojure-europe (65)
- # clojure-japan (1)
- # clojure-nl (1)
- # clojure-norway (89)
- # clojure-spec (1)
- # clojure-sweden (1)
- # clojure-uk (8)
- # clojurescript (14)
- # cursive (3)
- # datahike (1)
- # datomic (29)
- # emacs (8)
- # graalvm (20)
- # graphql (1)
- # gratitude (2)
- # helix (6)
- # hyperfiddle (65)
- # jobs-discuss (7)
- # leiningen (1)
- # lsp (6)
- # malli (14)
- # missionary (12)
- # nrepl (8)
- # off-topic (24)
- # polylith (29)
- # reagent (14)
- # sci (14)
- # shadow-cljs (6)
- # spacemacs (10)
- # sql (4)
I'm new to helix and trying on of the React Native examples... but I get this error:
Got a component with the name 'myapp$subnav1$TabA_render' for the screen 'Tab-A'. React Components must start with an uppercase letter. If you're passing a regular function and not a component, pass it as children to 'Screen' instead. Otherwise capitalize your component's name.
The related code looks like this:
(defnc Root [_] {:helix/features {:fast-refresh true}}
(let [{:keys [Navigator Screen]} (j/lookup tabs-nav)]
($ Navigator {}
($ Screen {:name "Tab-A" :component TabA})
($ Screen {:name "Tab-B" :component subnav2/TabB})
)))
looks related to this (found by googling the error message) https://www.reddit.com/r/Clojure/comments/tp8bua/react_native_with_reagent_complains_about_react/
it's a warning logged by react-navigation https://github.com/react-navigation/react-navigation/blob/ddc5705b979d62bb3a293f221ec954cbad3dfba4/packages/core/src/useNavigationBuilder.tsx#L233
you can ignore it, or you can change the name yourself by doing
(set! (.-displayName TabA) "TabA")
(set! (.-displayName subnav2/TabB) "TabB")
The set!
trick didn't work for be, but using the tab components as chils instead of using :component
did work. I'm sure I tried that yesterday, too!?
(defnc Root [_] {:helix/features {:fast-refresh true}}
(let [{:keys [Navigator Screen]} (j/lookup tabs-nav)]
($ Navigator {}
($ Screen {:name "Tab-A"} TabA)
($ Screen {:name "Tab-B"} subnav2/TabB)
)))
Thanks for all the answers! What a great community!