React native &引用;找不到变量:a";运行React本机应用程序时出错
当我在我的Android设备上运行这个React本机应用程序时,我在设备上看到一个错误:“找不到变量:a”。我该如何着手解决这个问题?我已经在下面发布了我的代码React native &引用;找不到变量:a";运行React本机应用程序时出错,react-native,React Native,当我在我的Android设备上运行这个React本机应用程序时,我在设备上看到一个错误:“找不到变量:a”。我该如何着手解决这个问题?我已经在下面发布了我的代码 import React, {Component} from 'react'; import {Platform, StyleSheet, Text, View} from 'react-native'; const instructions = Platform.select({ ios: 'Press Cmd+R to rel
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
const instructions = Platform.select({
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
android:
'Double tap R on your keyboard to reload,\n' +
'Shake or press menu button for dev menu',
});
type Props = {};
export default class App extends Component<Props> {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>Welcome to React Native!</Text>
<Text style={styles.instructions}>To get started, edit App.js</Text>
<Text style={styles.instructions}>{instructions}</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
import React,{Component}来自'React';
从“react native”导入{平台、样式表、文本、视图};
const指令=Platform.select({
ios:'按Cmd+R重新加载,\n'+'Cmd+D或抖动开发菜单',
安卓:
'双击键盘上的R以重新加载,\n'+
'为开发菜单摇动或按下菜单按钮',
});
类型Props={};
导出默认类应用程序扩展组件{
render(){
返回(
欢迎来到这里!
要开始,请编辑App.js
{指令}
);
}
}
const styles=StyleSheet.create({
容器:{
弹性:1,
为内容辩护:“中心”,
对齐项目:“居中”,
背景颜色:“#F5FCFF”,
},
欢迎:{
尺寸:20,
textAlign:'中心',
差额:10,
},
说明:{
textAlign:'中心',
颜色:'#333333',
marginBottom:5,
},
});
您正在使用TypeScript吗?如何删除类型Props={}代码>
更新
导出默认类应用程序扩展组件
致:
导出默认类应用程序扩展组件
是否使用TypeScript?如何删除类型Props={}代码>
更新
导出默认类应用程序扩展组件
致:
导出默认类应用程序扩展组件