Pitfalls working with @wordpress/data, useSelect and useDispatch and how to avoid those. #184
Replies: 2 comments
-
Discussion moved to issue |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This post would be an updated rewrite of Jarda Snajdr post on his personal blog two years ago.0
adding a few more practices and patterns that address problems that Jarda witnessed causing performance issues recently.
The useSelect hook implementation itself has also evolved significantly in the last year or so, having been rewritten to use React 18’s useSyncExternalStore, and adding optimizations like granular subscriptions to individual stores or conditional “lazy” subscriptions.
It would be for a reader who is already familiar with @wordpress/data and useSelect and useDispatch, uses them successfully to write a custom block or plugin, but wants to improve their game and to learn more details.
Note: Discussion title is a work in progress... it will be fixed in review process.
Beta Was this translation helpful? Give feedback.
All reactions