typescript - 如何獲取 expo-sqlite 的類型?
在 expo sdk 的 33 版本中,sqlite 被移到它自己的套件 expo-sqlite,現在我無法讓類型加載。
而不是
import {SQLite} from 'expo';
我有
import {SQLite} from 'expo-sqlite';
但是類型沒有被加載。
我得到以下類型錯誤:
Cannot find namespace 'SQLite'.
答案#1
你似乎還沒有下載這個模組。請安裝模組並應用它。
npm install expo-sqlite
答案#2
expo-sqlite 套件中缺少類型。我在 Expo 的 GitHub 頁面上開了一個問題,這個問題已經解決了。
GitHub 問題:https://github.com/expo/expo/issues/5264
Github 拉取請求: https://github.com/expo/expo/pull/5544
