Reactjs Expo错误:无法读取属性';状态栏高度';空的
如何在Expov34.0.0中修复此错误Reactjs Expo错误:无法读取属性';状态栏高度';空的,reactjs,react-native,expo,Reactjs,React Native,Expo,如何在Expov34.0.0中修复此错误 在Expo中,您不能再直接从“Expo”导入,因此更改为(旧方式): 至(更新方式): 同样,如果使用以下功能,请使用此格式: import MapView from 'react-native-maps'; import * as Location from 'expo-location'; import * as Permissions from 'expo-permissions'; import { DeviceMotion } from
在Expo中,您不能再直接从“Expo”导入,因此更改为(旧方式): 至(更新方式): 同样,如果使用以下功能,请使用此格式:
import MapView from 'react-native-maps';
import * as Location from 'expo-location';
import * as Permissions from 'expo-permissions';
import { DeviceMotion } from 'expo-sensors';
这很有帮助
如果您正在使用在线Expo编辑器,系统将提示您安装软件包,因此只需单击“确定”。否则,请运行:
expo install expo-constants
Expo将他们以前加入的许多库分开,而
常量
就是其中之一,要现在获取常量,请按照以下步骤操作:
expo常量
:import MapView from 'react-native-maps';
import * as Location from 'expo-location';
import * as Permissions from 'expo-permissions';
import { DeviceMotion } from 'expo-sensors';
expo install expo-constants
expo install expo-constants
import Constants from 'expo-constants';
const barHeight = Constants.statusBarHeight;