Skip to content

perf(virtualized-lists) removing rerender cells for every change of Virtualized list#46103

Closed
Tom910 wants to merge 1 commit into
facebook:mainfrom
Tom910:export-D61493434
Closed

perf(virtualized-lists) removing rerender cells for every change of Virtualized list#46103
Tom910 wants to merge 1 commit into
facebook:mainfrom
Tom910:export-D61493434

Conversation

@Tom910
Copy link
Copy Markdown
Contributor

@Tom910 Tom910 commented Aug 19, 2024

Summary:
Reducing the boundary of rerender of virtual lists. Previously with prop: "strictMode={true}" the VirtualizedList still re rendered each CellRenderer component. Because method getDerivedStateFromProps generated every time a new uniq state and the cells didn’t have a PureComponent. It helps to improve react performance for lists which have 5+ elements.

I reused recomended approach from react doc https://legacy.reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html#what-about-memoization

Differential Revision: D61493434

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Aug 19, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D61493434

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D61493434

…irtualized list (facebook#46103)

Summary:
Pull Request resolved: facebook#46103

Reducing the boundary of rerender of virtual lists. Previously with prop: "strictMode={true}" the VirtualizedList still re rendered each CellRenderer component. Because method getDerivedStateFromProps generated every time a new uniq state and the cells didn’t have a PureComponent. It helps to improve react performance for lists which have 5+ elements.

I reused recomended approach from react doc https://legacy.reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html#what-about-memoization

Reviewed By: NickGerleman, sammy-SC

Differential Revision: D61493434
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D61493434

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 954e294.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Aug 21, 2024
@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @Tom910 in 954e294

When will my fix make it into a release? | How to file a pick request?

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants