React native 我在构建项目时遇到了这个错误
当我使用react原生元素时,我遇到了这个错误 开发服务器返回响应错误代码:500 正文: 我正在windows机器上尝试androidReact native 我在构建项目时遇到了这个错误,react-native,React Native,当我使用react原生元素时,我遇到了这个错误 开发服务器返回响应错误代码:500 正文: 我正在windows机器上尝试android import React, {Component} from 'react'; import {StyleSheet,View,Button} from 'react-native'; import { FormLabel, FormInput, FormValidationMessage } from 'react-native-elements'; cl
import React, {Component} from 'react';
import {StyleSheet,View,Button} from 'react-native';
import { FormLabel, FormInput, FormValidationMessage } from 'react-native-elements';
class Login extends Component{
render() {
return (
<View style={styles.View}>
<FormLabel>Name</FormLabel>
<FormInput/>
<FormValidationMessage>Error message</FormValidationMessage>
<Button>
</Button>
</View>
);
}
}
只需从react-native而不是react-native元素导入FormLabel
import React, {Component} from 'react';
import {StyleSheet,View,Button} from 'react-native';
import { FormLabel, FormInput, FormValidationMessage } from 'react-native-elements';
class Login extends Component{
render() {
return (
<View style={styles.View}>
<FormLabel>Name</FormLabel>
<FormInput/>
<FormValidationMessage>Error message</FormValidationMessage>
<Button>
</Button>
</View>
);
}
}
import {StyleSheet,View,Button,FormLabel} from 'react-native';
import {FormInput, FormValidationMessage } from 'react-native-elements';