我正在使用 import @react-native-firebase/firestore Lib 我想在 firestore 資料庫中插入一個位置型別 geopoints 問題是不斷觸發錯誤說
不能將類作為函式呼叫
這是我呼叫函式的方式,位置是我的 firestore 欄位:
location : firestore.GeoPoint(lat, long)
我還嘗試從以下位置分別匯入 firebase:
import firebase from '@react-native-firebase/app'
進而 :
location : firebase.firestore.GeoPoint(lat, long)
我仍然遇到同樣的錯誤,我也嘗試過:
firebase.firestore.GeoPoint.latitude = lat ;
...
它沒有用,你能幫忙嗎
uj5u.com熱心網友回復:
錯誤訊息說這firestore.GeoPoint是一個類,您正試圖將其作為函式呼叫。
要創建 的實體firestore.GeoPoint,請執行以下操作:
location : new firestore.GeoPoint(lat, long)
// ??
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/338457.html
標籤:反应 火力基地 反应原生 谷歌云firestore
上一篇:Material-UI:WithStyles(ForwardRef(Dialog))中未實作提供給classes道具的關鍵`paperFullWidth`
