我在使用expo-cljs-template (lein new expo myapp +reagent
)来引导我的exporeact-nativereagentclojurescript应用。
因为我的应用程序需要geonencing,而在expo中,这需要一个 TaskManager
,我定义了一个 TaskManager
这样的任务。
(ns myapp.mod
(:require [oops.core :refer [ocall]])) ; javascript interop
(def taskmanager (js/require "expo-task-manager"))
; call outside of component as per react-native requirement
; to be done during initialization phase
(ocall taskmanager "defineTask" "task-name" (fn [data error] (prn "nowt")))
在我的应用中,我很早就开始运行了,甚至在需要图片之前就已经开始运行了 但我始终得到 TaskManager.defineTask must be called during initialization phase!
错误,用无花果轮开发模式运行。如果clojurescript的顶层和底层不是初始化阶段,那么什么时候是?是否有什么东西在我的clojurescript之前运行?我也试过在init函数内调用它,在app-root内调用它作为reagent type 3组件。
版本信息: expo "^34.0.3", react "16.8.3", react-native "34.0.0", expo-task-manager "~6.0.0", reagent "0.8.1"