This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-05
Channels
- # announcements (3)
- # beginners (225)
- # calva (3)
- # cider (110)
- # circleci (18)
- # clj-kondo (15)
- # cljdoc (1)
- # cljsrn (12)
- # clojure (77)
- # clojure-dev (39)
- # clojure-europe (3)
- # clojure-houston (2)
- # clojure-italy (9)
- # clojure-nl (16)
- # clojure-romania (1)
- # clojure-spec (5)
- # clojure-uk (20)
- # clojuredesign-podcast (28)
- # clojurescript (89)
- # core-async (4)
- # cursive (10)
- # datomic (3)
- # defnpodcast (5)
- # emacs (17)
- # events (1)
- # figwheel (4)
- # graalvm (6)
- # juxt (1)
- # pathom (4)
- # pedestal (5)
- # re-frame (4)
- # remote-jobs (3)
- # rewrite-clj (4)
- # shadow-cljs (90)
- # spacemacs (2)
- # sql (7)
- # tools-deps (4)
- # vim (52)
- # xtdb (7)
Also done š thanks for taking the time to work on this
Hi eveybody ! Is there a difference (maybe performance ?) to require react-native like this
(ns test.android.core
(:require [reagent.core :as r :refer [atom]]))
(def ReactNative (js/require "react-native"))
(def text (r/adapt-react-class (.-Text ReactNative)))
(defn app-root
[]
[text "Hello World!"])
...
Instead like this
(ns test.android.core
(:require [reagent.core :as r :refer [atom]]
["react-native" :as rn :erfer [Text]]))
(defn app-root
[]
[:> Text "Hello World!"])
...
no difference in performance no. otherwise the only difference is the amount of code
Perfect, thx @thheller ! Yes I prefer the second one and surprise to often see
(def ReactNative (js/require "react-native"))
(def app-registry (.-AppRegistry ReactNative))
(def text (r/adapt-react-class (.-Text ReactNative)))
(def view (r/adapt-react-class (.-View ReactNative)))
(def image (r/adapt-react-class (.-Image ReactNative)))
(def touchable-highlight (r/adapt-react-class (.-TouchableHighlight ReactNative)))
Like in Re-natal templatebut support for that came after re-natal came out so it probably just wasn't updated
I just tried the second version with re-natal/figwheel and it works well. Maybe I'll propose a pull request.
Notice : I do not test to build app right now