我正在编辑一个 '.js' 文件,在进行一些更改后保存了我的工作。当我在模拟器上键入“rr”以刷新应用程序时,我一直收到此消息。
Android 应用程序模拟器一直停止 应用信息 关闭应用 进入图像描述 在我的项目中的可视化代码编辑器下创建了 Form.js 并将其导入到我的 Login.js 中的组件文件夹下,这就是错误开始出现的地方。我不知道我做错了什么。我是 React Native 的新手,正在学习。
Android 应用程序模拟器一直停止 应用信息 关闭应用 进入图像描述 在我的项目中的可视化代码编辑器下创建了 Form.js 并将其导入到我的 Login.js 中的组件文件夹下,这就是错误开始出现的地方。我不知道我做错了什么。我是 React Native 的新手,正在学习。
Form.js
import React, {Component} from 'react';
import {
StyleSheet,
Text,
View,
TextInput
} from 'react-native';
export default class Login extends Component<{}> {
render(){
return(
<View style={styles.container}>
<TextInput style={styles.inputBox}
underlineColorAndroid='rgba(0,0,0,0)'
placeholder="Email"
placeholderTextColor = "#ffffff"
/>
<TextInput style={styles.inputBox}
underlineColorAndroid='rgba(0,0,0,0)'
placeholder="Password"
placeholderTextColor = "#ffffff"
/>
</View>
)
}
}
const styles = StyleSheet.create({
container : {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
},
inputBox: {
width:300,
backgroundColor:'rgba(255,255,255,0.3)',
borderRadius: 25,
paddingHorizontal: 16,
fontSize: 16,
color:'#ffffff',
marginVertical: '10'
}
});
Login.js
import React, {Component} from 'react';
import {
StyleSheet,
Text,
View,
StatusBar
} from 'react-native';
import Logo from '../components/Logo';
import Form from '../components/Form';
export default class Login extends Component<{}> {
render () {
return(
<View style={styles.container}>
<Logo/>
<Form/>
</View>
)
}
}
const styles = StyleSheet.create({
container : {
backgroundColor: '#29b6f6',
flex: 1,
alignItems: 'center',
justifyContent: 'center',
}
});
回滚您的更改。
然后再次执行命令
react-native run-android
。 - Paras Korat