Skip to content

Fix CommandScope render-time update in useCommand#2184

Merged
einari merged 1 commit into
mainfrom
fix/defer-command-scope-registration
May 1, 2026
Merged

Fix CommandScope render-time update in useCommand#2184
einari merged 1 commit into
mainfrom
fix/defer-command-scope-registration

Conversation

@einari
Copy link
Copy Markdown
Contributor

@einari einari commented May 1, 2026

Fixed

  • Prevent CommandScope state updates from being triggered during render by registering commands in useEffect inside useCommand.

Register commands with the scope in an effect instead of render.
This prevents React warnings about updating CommandScope while
another component is rendering.
@einari einari added the patch label May 1, 2026
@einari einari merged commit c54320e into main May 1, 2026
7 checks passed
@einari einari deleted the fix/defer-command-scope-registration branch May 1, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant