I'm using the expo-cljs-template (lein new expo myapp +reagent) to bootstrap my expo/react-native/reagent/clojurescript app.
Because my application needs geofencing, and in expo that needs a TaskManager, I define a TaskManager task like so:
(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")))
I've got this running very early in my app, before even images are required. But I consistently get the TaskManager.defineTask must be called during initialization phase! error, running with figwheel dev-mode. If the top and base level of the clojurescript is not initialization phase, then when is? Is something run before my clojurescript? I've also tried calling it within the init function and within app-root as a reagent type 3 component.
Version information: expo "^34.0.3", react "16.8.3", react-native "34.0.0", expo-task-manager "~6.0.0", reagent "0.8.1"