Я пытаюсь создать простое приложение Map, используя Expo и Clojurescript, но когда я пытаюсь отобразить карту, я получаю следующую ошибку:
Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
Вот как выглядит код:
(ns map-test.core
(:require [reagent.core :as r :refer [atom]]
[re-frame.core :refer [subscribe dispatch dispatch-sync]]
[oops.core :refer [ocall]]
[map-test.handlers]
[map-test.subs]))
(def ReactNative (js/require "react-native"))
(def expo (js/require "expo"))
(def view (r/adapt-react-class (.-View ReactNative)))
(def text (r/adapt-react-class (.-Text ReactNative)))
(def MapView (js/require "react-native-maps"))
(def map-view (r/adapt-react-class MapView))
(defn app-root []
[view {:style {:flex 1}}
[map-view]])
(defn init []
(dispatch-sync [:initialize-db])
(ocall expo "registerRootComponent" (r/reactify-component app-root)))
Это мой package.json
:
{
"name": "map-test",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"main": "main.js",
"dependencies": {
"expo": "^34.0.3",
"react": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz",
"create-react-class": "15.6.3",
"react-native-maps": "~0.24.0"
}
}
Я пытался следовать приведенному здесь ответу: Использование React Native MapView в реагенте ClojureScript , но это не так Кажется, что это работает.
Вся помощь оценена!