Fork me on GitHub
#cljsrn
<
2016-01-01
>
grischoun20:01:38

I am trying to import a module using '(def tab-view (js/require "react-native-scrollable-tab-view/index.js"))' but I keep getting that the module is unknown. I have installed the module using nam and launch my app using re-natal but without success. Does anyone have a hint? I have been stuck on this for while.

mfikes20:01:41

@grischoun: I’ve found it easiest to just fish the correct name out of the bundled JavaScript. (I’d point you to a blog post where I did this, but Linode is having an outage 😞 )

grischoun20:01:27

@mkifes: Thanks. Is this the link you are referring to http://blog.fikesfarm.com/posts/2015-07-24-using-react-native-components-in-clojurescript.html ? If so, yes, unfortunately it is down.

mfikes21:01:47

@grischoun: yep. That one

mfikes21:01:37

@grischoun: IIRC, the two steps are (1) refer to the dep in index.ios.js as if you were going to actually use it there, (2) this causes it to appear in the JavaScript bundled by the packager; just surf to its URL in your browser and search for, say, “TabView” or “tab-view”. With luck you'll find the module ID string.

grischoun21:01:28

@mfikes: I see. I'll try that. Thanks again.