Fork me on GitHub
#cljsrn
<
2018-08-04
>
fabrao12:08:23

Hello all, if I use in react-native import { something } from 'something-else'; -> (def Something (js/require "something-else")), what would be use for import something from 'something-else'; ?

jeaye16:08:35

Take a look at https://github.com/binaryage/cljs-oops and use (oget something-else :something)

smogg20:08:23

Hi. I'm just starting out with bare-bones re-natal app and trying to add react-navigation. I'm keep getting "Unknown named module: ..." error. I've added the module with react-native install react-navigation and I've restarted figwheel and the simulator. What am I doing wrong? Is this the right way to introduce new deps in the project?

smogg20:08:28

I'm trying to load the module with: (def react-navigation (js/require "react-navigation"))

fabrao21:08:27

@smogg have you included it into project?

smogg21:08:56

@fabrao what would "including" entail exactly?

smogg21:08:10

I just installed the dep with `npm install` react-native install

smogg21:08:19

and then tried to require it in cljs namespaces

fabrao21:08:23

the first file you have to see is android\settings.graddle and see if it´s included there

fabrao21:08:13

you have to see if there is include ´:react-native-navigation'

smogg21:08:33

Nope, it's not here

smogg21:08:42

(i'm running ios simluator btw)

fabrao21:08:47

so that´s is the problem

smogg21:08:49

is all this documented somewhere?

fabrao21:08:37

I didn´t work with ios until now

fabrao21:08:46

just android

smogg21:08:22

Gotcha. Well, thanks anyway!

fabrao22:08:21

r u using with figwheel?

joshmiller22:08:41

@smogg You need to re-natal use-component react-navigation

❤️ 4
joshmiller22:08:59

That will add it to your index.*.js

smogg22:08:52

@joshmiller I've had enable-auto-require option on and thought this would happen automagically. But that worked, thank you!

👍 4
joshmiller22:08:14

@smogg You still need to re-natal use-figwheel for it to scan and find new components that way, but I have mostly just stuck to doing it manually because it’s easier than tracking it down if it fails for some reason.

smogg22:08:31

Yeah, I've just re-read the docs too

smogg22:08:40

thanks again!