You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use local state for commit context menu state to reduce rerenders
Summary:
This is an alternate version of D116326998 that is a bit simpler / more targeted. This should give the same perf win while also simplifying the code a bit.
The underlying issue was that actioningCommit was global state that every commit subscribed to, so context menu triggered every commit to rerender. WIth giant dags this can be noticeable.
By making this state local to the component (useState instead of jotai atom), we only rerender the current atom.
Well, that would be true but we also need to update the dismissal path, which luckily we can do with useContextMenu.
Reviewed By: stbfb
Differential Revision: D116696808
fbshipit-source-id: d8a6a8cd39dba03c2f8df7b40af7e90bd7a9cb4f
0 commit comments