r/Clojurescript • u/chowbeyputra • Jan 23 '22
Import external libraries from react-native.
Hi, I am using Krell for react-native and trying to use contacts but nothing seems to work.
The last thing I tried was (:require ["react-native-contacts" :as contacts]) for importing and (.getAll contacts) for the js counterpart :
Contacts.getAll().then(contacts => { // contacts returned })
but got this error:
[TypeError: undefined is not an object (evaluating 'xxxx.core.node$module$react_native_contacts.getAll')]
What am I missing?
2
Upvotes
View all comments
Show parent comment
1
u/chowbeyputra Feb 28 '22
Oh it’s so weird. I stopped everything.. krell.. metro.. emulator.. machine.. and restarted everything.. only then it worked .. but then a normal [react-native-contacts :as Contacts] works out.