我相对较新,对本机做出反应,并且通常使用 UI 构建任何东西。我想知道在render{}编写应用程序时何时适合使用该功能。我问这个是因为我想知道对应用程序的影响。例如,如果我创建一个<LinkedIcon>组件并尝试在一个屏幕上显示大量组件,那么每个点都应该调用render. 如果不是,我会怎么做。
示例代码:
import React, { Component } from "react";
import { Linking, View, TouchableHighlight } from "react-native";
import Icon from "react-native-vector-icons/FontAwesome";
class LinkedIcon extends Component<Props> { //will show about up to 20 on one screen
render() {
return (
<TouchableHighlight>
<Icon title="circle" size={15} />
</TouchableHighlight>
);
}
}
export default LinkedIcon;
吃鸡游戏
相关分类