gpt4 book ai didi

reactjs - react 原生 TypeScript 错误 : Module '"react-native "' has no exported member ' Appearance'

转载 作者:行者123 更新时间:2023-12-04 12:05:27 27 4
gpt4 key购买 nike

我最近在我的应用程序中实现了暗模式,但是在使用 npm build 构建 npm 包时遇到了一个错误问题。 .该代码有效,但有没有办法或理由消除此错误?
React Native Docs: Appearance
错误

src/ContactActionSheet.tsx:3:10 - error TS2305: Module '"react-native"' has no exported member 'Appearance'.

3 import { Appearance, Dimensions, StyleSheet, Text, View, Linking, TouchableOpacity } from 'react-native';
JSX
// Imports: Dependencies
import { Appearance, Dimensions, StyleSheet, Text, View, Linking, TouchableOpacity } from 'react-native';

// Dark Mode
const colorScheme = Appearance.getColorScheme();

最佳答案

问题出在 npm 包 @types/react-native需要更新。

关于reactjs - react 原生 TypeScript 错误 : Module '"react-native "' has no exported member ' Appearance',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63334338/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com