我一直在按照 YouTube 教程进行编码,并且遇到了此错误消息。我已经安装了正确的导入语句和正确的依赖项,所以我不确定问题是什么。
我在其中调用 Anticon 的组件:
import React from 'react';
import {View, TextInput, StyleSheet} from 'react-native';
import {windowHeight, windowWidth} from '../utils/Dimensions';
import AntDesign from 'react-native-vector-icons/AntDesign';
const FormInput = ({labelValue, placeholderText, iconType, ...rest}) => {
return (
<View style={styles.inputContainer}>
<View style={styles.iconStyle}>
<AntDesign name={iconType} size={25} color="#666" />
</View>
<TextInput
value={labelValue}
style={styles.input}
numberOfLines={1}
placeholder={placeholderText}
placeholderTextColor="#666"
{...rest}
/>
</View>
);
};
export default FormInput;
const styles = StyleSheet.create({
inputContainer: {
marginTop: 5,
marginBottom: 10,
width: '100%',
height: windowHeight / 15,
borderColor: '#ccc', …Run Code Online (Sandbox Code Playgroud)