disable fast refresh on ios and bump re-frisk

Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
andrey 2021-01-20 10:39:38 +01:00
parent fa4521d2e7
commit af2b053fa9
No known key found for this signature in database
GPG Key ID: 89B67245FD2F0272
2 changed files with 12 additions and 3 deletions

View File

@ -16,7 +16,7 @@
[refactor-nrepl "2.5.0"] [refactor-nrepl "2.5.0"]
[cider/cider-nrepl "0.25.3"] [cider/cider-nrepl "0.25.3"]
[cider/piggieback "0.4.1"] [cider/piggieback "0.4.1"]
[re-frisk-remote "1.3.1"] [re-frisk-remote "1.3.7"]
;; routing ;; routing
[bidi "2.1.6"] [bidi "2.1.6"]
;; test dependencies ;; test dependencies

View File

@ -5,7 +5,7 @@
["react-native-languages" :default react-native-languages] ["react-native-languages" :default react-native-languages]
["react-native-shake" :as react-native-shake] ["react-native-shake" :as react-native-shake]
["react-native-screens" :refer (enableScreens)] ["react-native-screens" :refer (enableScreens)]
["react-native" :as rn] ["react-native" :as rn :refer (DevSettings)]
[re-frame.core :as re-frame] [re-frame.core :as re-frame]
[re-frame.interop :as interop] [re-frame.interop :as interop]
[reagent.core :as reagent] [reagent.core :as reagent]
@ -80,6 +80,14 @@
:display-name "root" :display-name "root"
:reagent-render views/main})) :reagent-render views/main}))
(defn disable-rn-fast-refresh []
;;on Android this method doesn't work
(when (and js/goog.DEBUG platform/ios? DevSettings)
(when-let [nm (.-_nativeModule DevSettings)]
;;there is a bug in RN, so we have to enable it first and then disable
(.setHotLoadingEnabled ^js nm true)
(js/setTimeout #(.setHotLoadingEnabled ^js nm false) 1000))))
(defn init [] (defn init []
(utils.logs/init-logs config/log-level) (utils.logs/init-logs config/log-level)
(error-handler/register-exception-handler!) (error-handler/register-exception-handler!)
@ -91,4 +99,5 @@
(notifications/listen-notifications) (notifications/listen-notifications)
(when platform/android? (when platform/android?
(.registerHeadlessTask ^js app-registry "LocalNotifications" notifications/handle)) (.registerHeadlessTask ^js app-registry "LocalNotifications" notifications/handle))
(snoopy/subscribe!)) (snoopy/subscribe!)
(disable-rn-fast-refresh))