Javascript 未定义的错误不是对象(正在计算‘;expo.Constants.statusBarHeight’;)
使用Javascript 未定义的错误不是对象(正在计算‘;expo.Constants.statusBarHeight’;),javascript,node.js,react-native,expo,Javascript,Node.js,React Native,Expo,使用paddingTop:Constants.statusBarHeight 我使用了从“世博会”导入的{Consants} 这段代码是我在大学期间做的上一个项目中复制的,但现在似乎不起作用了 const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: "#3498db", justifyContent: "center", paddingTop: Constants.st
paddingTop:Constants.statusBarHeight
我使用了从“世博会”导入的{Consants}
这段代码是我在大学期间做的上一个项目中复制的,但现在似乎不起作用了
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#3498db",
justifyContent: "center",
paddingTop: Constants.statusBarHeight
},
首先运行以下命令
sh
yarn install expo-constants
接下来
import Constants to your App.js
import Constants from "expo-constants";
首先运行以下命令
sh
yarn install expo-constants
接下来
import Constants to your App.js
import Constants from "expo-constants";
我能知道为什么我的问题得到-1吗?是的,我真的不知道为什么它不再工作了尝试:常量现在是一个独立的包,所以运行:expo安装expo常量,然后从'expo Constants'导入常量thx工作了,但现在我得到了diff error
createStackNavigator()
已移动到反应导航堆栈
,这是否也是由于新sdk版本更改后无法从“node\u modules\@react navigation\stack\src\navigators\createStackNavigator.tsx”解析“@react navigation/native”导致的?是的,我真的不知道为什么它不再工作了尝试:常量现在是一个单独的包,所以运行:expo安装expo常量,然后从'expo Constants'导入常量thx工作,但现在我得到了diff errorcreateStackNavigator()
已移动到react导航堆栈
,这是否也是由于新sdk版本更改后无法从“node\u modules\@react navigation\stack\src\navigators\createStackNavigator.tsx”解析“@react navigation/native”而导致的