Fork me on GitHub
#cljsrn
<
2021-05-23
>
Ale02:05:23

Is there a better way than this to import "default" in krell?

(ns dondai.core
    (:require [clojure.string :as string]
              ... other imports
              ["react-native-vector-icons/MaterialCommunityIcons" :as rnvi-MaterialCommunityIcons]
              ))
(def MaterialCommunityIcons (aget rnvi-MaterialCommunityIcons "default"))
I tried importing it like
(ns dondai.core
    (:require [clojure.string :as string]
              ... other imports
              ["react-native-vector-icons/MaterialCommunityIcons"
               :refer [default] :rename {default MaterialCommunityIcons}]
              ))
but this way MaterialCommunityIcons is undefined

thheller06:05:55

@laynor ["react-native-vector-icons/MaterialCommunityIcons$default" :as MaterialCommunityIcons], see https://clojurescript.org/news/news#_new_core_features