MCPcopy Create free account
hub / github.com/adobe/react-spectrum / ContextActionButton

Function ContextActionButton

packages/@react-spectrum/s2/test/Menu.test.tsx:153–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151describe('Context propagation', () => {
152 it('preserves the ActionButton context from its parent', () => {
153 function ContextActionButton() {
154 let {staticColor} = useSlottedContext(ActionButtonContext) || {};
155 return (
156 <ActionButton data-static-color={staticColor} aria-label="Menu button">
157 Menu button
158 </ActionButton>
159 );
160 }
161
162 let {getByRole} = render(
163 <Provider values={[[ActionButtonContext, {staticColor: 'auto'}]]}>

Callers

nothing calls this directly

Calls 1

useSlottedContextFunction · 0.85

Tested by

no test coverage detected