Skip to content

FlatList More complex, multi-select example  #1529

Description

@hossamnasser938

The example provided in the FlatList article is supposed to rerender the FlatList only when passing extraData prop. However, the FlatList rerenders on IOS and Android whether extraData prop is passed or not. The strange thing is that the example works fine on web.

ezgif com-video-to-gif

Activity

  1. HectorRicardo commented on Apr 24, 2020

    @HectorRicardo

    I believe there is a mistake in this example. The documentation of FlatList states that:

    This is a PureComponent which means that it will not re-render if props remain shallow-equal. Make sure that everything your renderItem function depends on is passed as a prop (e.g. extraData) that is not === after updates, otherwise your UI may not update on changes. This includes the data prop and parent component state.

    The problem is that the renderItem prop is passed as an inline function, thus the section list will rerender in every App's rerender. Therefore, the extraData parameter is useless in this example. The documentation should show another example of how to use the extraData prop correctly.

  2. HectorRicardo commented on Apr 24, 2020

    @HectorRicardo

    Also, can you reword this phrase ?

    Make sure that everything your renderItem function depends on is passed as a prop (e.g. extraData) that is not === after updates, otherwise your UI may not update on changes.

    Seems grammatically incorrect (which is the verb, "is" or "updates" ?).

  3. stale commented on Aug 16, 2020

    @stale

    👋 Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

  4. added
    StaleIssues/PR that are not getting much activity and are closer to be closed
    on Aug 16, 2020
  5. HectorRicardo commented on Aug 16, 2020

    @HectorRicardo

    @Stale This should remain open

  6. removed
    StaleIssues/PR that are not getting much activity and are closer to be closed
    on Aug 16, 2020
  7. stale commented on Dec 25, 2020

    @stale

    👋 Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

  8. added
    StaleIssues/PR that are not getting much activity and are closer to be closed
    on Dec 25, 2020
  9. stale commented on Jan 9, 2022

    @stale

    Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleIssues/PR that are not getting much activity and are closer to be closed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions