Fork me on GitHub
#cljsrn
<
2018-01-19
>
codxse11:01:52

hi all, I'm struggling importing npm libs,.. need help.. let say import { Button, Card } from 'react-native-material-design'; how do I translate it to clojurescript? I have added react-native-material-design to package.json but, when I require it, it return error x'(

danielneal11:01:07

@codxse I recommend oops for object access (https://github.com/binaryage/cljs-oops) which makes extern problems go away I'm using expo and cljs, and the translation would be like this

(def react-native-material-design (js/require "react-native-material-design"))
(def button (oget react-native-material-design "Button"))
(def card (oget react-native-material-design "Card"))

codxse11:01:44

Ok, thanks, let me try :))

danielneal11:01:27

what's your setup? Are you using expo or re-natal?

codxse11:01:49

but it's no problem,

danielneal11:01:05

ah yeah it looks like it's the same syntax

andre21:01:18

what do you think guys?