Flatlist也不会因添加额外数据道具而重新呈现

时间:2019-10-02 07:11:02

标签: react-native react-native-flatlist

我正在尝试使用本机的Extradata道具重新渲染本机列表。但不幸的是,在我看来,这还没有恢复。我有一个下拉菜单,从中选择任何项目,该项目应立即显示在平面列表中。因此,我尝试使用Flatlist的Extradata道具,但无法正常工作。 以下是我的参考代码段:

<ListItem
     title={`${item.disease}`}
     titleStyle={{ fontSize: 16, fontFamily: 'Quicksand-Bold', color: '#FFF', fontWeight: 'bold' }}
     containerStyle={{ backgroundColor: index % 2 == 0 ? "#5B2299" : "#330661" }}
     rightIcon={
      <Icon
      name="delete-circle"
      size={30}
      color="red"
      iconContainerStyle={{ backgroundColor: '#1D80B5', color: '#FFF' }}
      onPress = {() => this.deleteClientDiseases(item.disease)}
      />
   }
/>

0 个答案:

没有答案