ALI*_*EEN 10 typescript react-native
我收到以下警告:
在 iOS 模拟器上运行应用程序时出现“覆盖字体家族样式属性预处理器”。StyleSheet.js不过我还没有在 Android 上测试过。
应用程序.tsx
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
export default function App() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<StatusBar style="auto" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});Run Code Online (Sandbox Code Playgroud)
包.json
{
"main": "index.js",
"scripts": {
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"start": "react-native start"
},
"dependencies": {
"expo": "~43.0.0",
"expo-splash-screen": "~0.13.3",
"expo-status-bar": "~1.1.0",
"expo-updates": "~0.10.5",
"react": "17.0.2",
"react-dom": "17.0.1",
"react-native": "0.66.1",
"react-native-gesture-handler": "~1.10.2",
"react-native-reanimated": "~2.2.0",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.8.0",
"react-native-web": "0.17.1"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@types/react": "^17.0.32",
"@types/react-native": "^0.66.1",
"typescript": "^4.4.4"
},
"private": true
}
Run Code Online (Sandbox Code Playgroud)
是不是包的问题?
abd*_*rza -2
当我尝试升级我的 React Native 依赖项时,我遇到了同样的问题,将 "react-native": "0.66.1" 更改为 "react-native": "0.64.2",然后运行
yarn install
or
npm install
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3439 次 |
| 最近记录: |