This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-11
Channels
- # babashka (13)
- # beginners (17)
- # bristol-clojurians (1)
- # calva (23)
- # cider (5)
- # clj-kondo (32)
- # cljsrn (2)
- # clojure (167)
- # clojure-dev (23)
- # clojure-europe (6)
- # clojure-uk (8)
- # clojurescript (5)
- # cursive (7)
- # datomic (12)
- # emacs (4)
- # events (6)
- # fulcro (2)
- # graalvm (1)
- # interop (10)
- # leiningen (8)
- # local-first-clojure (1)
- # luminus (2)
- # meander (36)
- # planck (3)
- # re-frame (3)
- # reagent (3)
- # sci (2)
- # spacemacs (4)
- # sql (1)
- # test-check (6)
- # tools-deps (22)
- # xtdb (75)
Hi everyone, I am moving my very first steps with the cljsrn
stack, I think I am missing some basics.. I am trying to use reagent
to make adapt the react native class but I am doing something wrong, can anybody help me with the right conversion? Thank you in advance!
(ns awesome.main
(:require [react]
[reagent.core :as r]
[react-native :as rn]))
(def <> react/createElement)
(defn example-component []
(<> rn/View
#js {:style #js {:backgroundColor "#FFFFFF"
:flex 1
:justifyContent "center"}}
(<> rn/Text
#js {:style #js {:color "black"
:textAlign "center"}}
(str "hello WORLD!!"))))
(def view (r/adapt-react-class rn/View))
(def text (r/adapt-react-class rn/Text))
(defn reagent-component []
[view {:style {:backgroundColor "#FFFFFF"
:flex 1
:justifyContent "center"}}
[text {:style {:color "black"
:textAlign "center"}} "Hello!"]])