This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-06
Channels
- # announcements (18)
- # asami (3)
- # aws (10)
- # babashka (47)
- # beginners (343)
- # calva (36)
- # cider (4)
- # clojure (66)
- # clojure-europe (9)
- # clojure-nl (3)
- # clojure-uk (23)
- # clojurescript (30)
- # community-development (69)
- # conjure (1)
- # eastwood (9)
- # events (7)
- # fulcro (81)
- # graalvm (1)
- # malli (5)
- # meander (1)
- # off-topic (41)
- # pathom (15)
- # rdf (1)
- # reitit (6)
- # sci (57)
- # shadow-cljs (18)
- # spacemacs (4)
- # startup-in-a-month (1)
- # testing (2)
- # vim (1)
@claudius.nicolae I guess hacky but there’s this https://github.com/ptaoussanis/encore/blob/master/src/taoensso/encore.cljc#L307
@claudius.nicolae That’s exactly the same as the one you’ve posted in the link, nevermind
I am using the react navigation library to create a Bottom Navigator as follows, and I’m using reagent with react-native
(defn root-comp []
(let [Tab (createBottomTabNavigator)]
[:> Tab.Navigator
[:> Tab.Screen {:name "Home" :component [:> View]}]]
)])
However, I’m getting the following error:
undefined is not an object (evaluating ‘Object.keys(routeConfigs)’)
how to fix this error?
I’ve also tried replacing Tab.Navigator with (. Tab -Navigator) and so forth but am getting the same error
Seems like routeConfigs
is undefined
, whatever and wherever it is.
Try enabling breaking on every exception and see where it breaks while browsing through the call stack.
Tab.Screen
expects a React component but you're passing it a Hiccup vector.
Even if it were expecting a React element, you would still have to convert the Hiccup vector into a React element with reagent.core/as-element
.
In this case, what you need to do depends on what View
is.
One more thing - the Tab.Navigator
syntax is not strictly correct. It works but not because it should but rather because of historical reasons IIRC.
Ideally, it should be (.-Navigator Tab)
where Tab
is defined with the ^js
tag.
View is the standard react-native View
just evaluating the (createBottomTabNavigator) is giving the following error:
undefined is not an object
evaluating Object.keys(routeConfigs)
changing component to the following:
(defn root-comp []
(let [Tab createBottomTabNavigator]
[:> (. Tab -Navigator)
[:> (. Tab -Screen) {:name "Home" :component (r/as-element [:> View])}]
#_[:> (. Tab -Screen) {:name "Investments" :component [:> View]}]]
)
#_[:> SafeAreaView
[:> View
[google-signin-comp]
[:> Text "Signed in " (if @(subscribe [:signed-in]) "Signed In" "Not Signed In")]
]])
gives the following error:Element type is invalid: expected a string (for built-in components) or a class/function but got:undefined
> just evaluating the (createBottomTabNavigator) is giving the following error Means it's something inside the library. I don't see anything in your code that would cause it.
[“react-navigation-tabs” :refer (createBottomTabNavigator)]
In js the function call works
then why doesn’t it in cljs?
Sorry, no idea - I don't work with React Native so I cannot really check.
But the documentation says that you should import it from @react-navigation/bottom-tabs
, not from react-navigation-tabs
. Maybe there's no difference, no idea.
two different sections in the documentation import from each, so both should work. However, using bottom tabs gives me the error that the app isn’t registered
Is anyone running https://github.com/Olical/cljs-test-runner? I have been getting this error message when I run it and I haven’t been able to figure it out. > Error: Cannot find module ‘xmlhttprequest’ > Require stack: > - /Users/aj/Documents/lumanu/ic/cljs-test-runner-out/ajax/xml_http_request.js > - /Users/aj/Documents/lumanu/ic/cljs-test-runner-out/goog/bootstrap/nodejs.js > - /Users/aj/Documents/lumanu/ic/cljs-test-runner-out/cljs_test_runner.gen.js > at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15) > at Function.Module._load (internal/modules/cjs/loader.js:898:27) > at Module.require (internal/modules/cjs/loader.js:1089:19) > at require (internal/modules/cjs/helpers.js:73:18) > at /Users/aj/Documents/lumanu/ic/cljs-test-runner-out/ajax/xml_http_request.cljs:35:25 > at Object.<anonymous> (/Users/aj/Documents/lumanu/ic/cljs-test-runner-out/ajax/xml_http_request.js:32:3) > at Module._compile (internal/modules/cjs/loader.js:1200:30) > at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10) > at Module.load (internal/modules/cjs/loader.js:1049:32) > at Function.Module._load (internal/modules/cjs/loader.js:937:14)
@U38J3881W Maybe you can provide some insight here?