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

Function ContextActionButton

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

useSlottedContextFunction · 0.85

Tested by

no test coverage detected