[英]react native define props type
我不知道'<'道具'>'。 尋找使用道具,我發現使用另一個道具 為什么道具是使用“類型”和'<'道具'>'? 什么意思? 請回答我的問題
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>
);
}
}
您可以刪除type Props = {};
然后刪除Component<Props>
'props'
,然后開始編碼
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.