This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-24
Channels
- # announcements (1)
- # beginners (113)
- # calva (16)
- # cider (6)
- # cljsrn (1)
- # clojure (104)
- # clojure-argentina (2)
- # clojure-dev (3)
- # clojure-italy (1)
- # clojure-nl (10)
- # clojure-spec (6)
- # clojure-uk (4)
- # clojuredesign-podcast (44)
- # clojurescript (25)
- # core-async (2)
- # datomic (21)
- # emacs (14)
- # events (1)
- # figwheel-main (12)
- # fulcro (7)
- # joker (2)
- # leiningen (1)
- # mount (7)
- # music (1)
- # off-topic (16)
- # pedestal (3)
- # re-frame (8)
- # reagent (8)
- # reitit (11)
- # shadow-cljs (4)
- # spacemacs (16)
- # sql (1)
- # tools-deps (14)
- # vim (1)
I have some time for my react native app again. All the spikes are pretty much done, I’m starting the actual app now. So I’m starting from scratch with a new react native app. I make the minimal modifications to use CLJS and hot loading with shadow, the same ones as before, and guess what: it doesn’t work 😞 I’ve been looking at docs, forums, zulip, cannot find a solution. What am I doing wrong?
(ns app.core
(:require [reagent.core :as r :refer [atom]]
["react-native" :as rn :refer [AppRegistry, Platform]]))
(defn app-root []
[:> rn/View
[:> rn/Text "First line"]
#_[:> rn/Text "------------------"]
[:> rn/Text "Second line"]
[:> rn/Text "Hi!!!!"]])
(defonce app-root-ref (atom nil))
(def updatable-app-root
(with-meta app-root
{:component-did-mount
(fn [this]
(println "did mount")
(reset! app-root-ref ^js this))}))
(defn init []
(.registerComponent AppRegistry
"Han"
#(r/reactify-component updatable-app-root)))
(defn reload {:dev/after-load true} []
(.forceUpdate ^js @app-root-ref))
The only real difference with before that I can think of, is that I’m using RN 0.60 now.