-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mobile - Inserter - Fix useSelect warnings for SearchResults and ReusableBlocksTab #53813
Conversation
…ic from it to avoid unnecessary re-renders
Size Change: 0 B Total Size: 1.51 MB ℹ️ View Unchanged
|
…ering logic outside into a useMemo
Flaky tests detected in 46f89c3. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5904004074
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@geriux I can't speak too much for the RN code changes but it seems to make sense to me. The manual tests passed for me. 🚀
Thank you!
Addresses part of #53738
Related PRs:
What?
After the #53666 merge, some warnings started to appear when opening/interacting with the inserter menu due to the usage of some
useSelect
.Why?
To avoid showing these warnings while running the app in development mode and to improve the performance by preventing unnecessary re-renders.
How?
This PR addresses the warnings by extracting the filtering logic from
useSelect
within theSearchResults
andReusableBlocksTab
components, to avoid returning new references and now they're stored in a variable wrapped in auseMemo
.Testing Instructions
useSelect
Testing Instructions for Keyboard
N/A
Screenshots or screencast
InserterWarningsBefore.mov
InserterWarningsAfter.mov