【发布时间】:2018-08-29 13:16:00
【问题描述】:
我有以下来自 youtube 教程的代码(我刚刚开始使用 react native):
import React, {Component} from 'react';
import { Text, StyleSheet, View, TextInput, ScrollView, TouchableOpacity} from 'react-native';
type Props = {};
export default class Main extends Component<Props> {
render() {
return (
<View style={styles.container}>
<Veiw style={styles.header}>
<Text style={styles.headerText}>
Todo List
</Text>
</Veiw>
<ScrollView style={style.ScrollContainer}>
</ScrollView>
<Veiw style={style.footer}>
<TextInput styles={styles.TextInput} placeholder='>Todo' placeholder = 'white' underlineColorAndroid = 'transparent'>
</TextInput>
</Veiw>
</View>
);
}
}
但是当我在我的 android 模拟器上运行它时,我收到以下错误消息:
ReferenceError 找不到变量:Veiw
我知道错误很清楚,但我在应用程序的开头导入了 Veiw,为什么没有注册?
【问题讨论】:
-
你只是没有导入“Veiw”,你导入了“View”,这样写才是对的。
-
别忘了把最有用的答案标记为正确答案!
标签: android react-native