Name a scope's element — the primitive CommandScopeProvider is built on, for a component
that already owns both. Bounds the scope's region (CommandScope.attachBounds) so its commands
only dispatch for keystrokes born inside the element; region additionally records it in the tree's
region index as a focus leaf (true ⇒ the scope is the anchor, an AnchorSource ⇒ a live leaf).
Prefer the provider — <CommandScopeProvider scope={…} elementRef={…}> — which also puts the scope in
context for the subtree; reach for the hook when the element and the scope are already in hand and
there is nothing to wrap.
Re-attaches when scope, elementRef or region changes and detaches on unmount. A null scope is a
no-op, so a chromeless host degrades quietly.
Name a scope's element — the primitive CommandScopeProvider is built on, for a component that already owns both. Bounds the scope's region (CommandScope.attachBounds) so its commands only dispatch for keystrokes born inside the element;
regionadditionally records it in the tree's region index as a focus leaf (true⇒ the scope is the anchor, an AnchorSource ⇒ a live leaf).Prefer the provider —
<CommandScopeProvider scope={…} elementRef={…}>— which also puts the scope in context for the subtree; reach for the hook when the element and the scope are already in hand and there is nothing to wrap.Re-attaches when
scope,elementReforregionchanges and detaches on unmount. Anullscope is a no-op, so a chromeless host degrades quietly.