@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.
Also, this is definitely wrong: :component [:> View]
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.
Just in case - how did you import createBottomTabNavigator
?
[“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
• I have actually read that and it is clear enough 🙂 • It's just that, Helix and other libraries tries to achieve the same - on the surface • But on digging further one can get an idea how they differentiate • AFAIS, Helix is tiny/minimal library
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)
Hmm I've never seen this before I'm afraid, I'd guess it's to do with your clojurescript version or setup more than anything?
I'm sorry I can't help more 😞
I don't ever try to use xmlhttprequest, so I think it's something slightly lower level than cljs-test-runner?
@olical Maybe you can provide some insight here?