FlatList renderItem is called multiple times

前端 未结 2 1377
梦谈多话
梦谈多话 2020-11-30 15:23

I\'m using FlatList to display data from an API call:

render() {
  const { navigation } = this.props;
  const animating = this.state.animating;

  return (
          


        
2条回答
  •  鱼传尺愫
    2020-11-30 16:27

    Normal re renders are normal in RN. That is just RN updating the react tree and updating views. If you dont have a performance issue then you can ignore this.

    Otherwise, please explain the problem because the console log is fine. Render item executes for EACH item in the data array you pass to FlatList. That is the render function for each item, not the render for the whole list.

    If this is not clear enough, and it is easier for you, feel free to add here a comment in Spanish and then we can update the answer (Only saying this since by your user, you seam spanish speaker as I am)

提交回复
热议问题