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

Function SelectionStatic

packages/react-aria-components/test/Menu.test.tsx:2223–2246  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

2221];
2222
2223function SelectionStatic(props) {
2224 let {selectionMode = 'single'} = props;
2225 let [selected, setSelected] = React.useState<Selection>(new Set());
2226 return (
2227 <MenuTrigger>
2228 <Button>Menu Button</Button>
2229 <Popover>
2230 <Menu
2231 aria-label="Test"
2232 selectionMode={selectionMode}
2233 selectedKeys={selected}
2234 onSelectionChange={setSelected}>
2235 <MenuSection>
2236 <Header>Heading 1</Header>
2237 <MenuItem>Foo</MenuItem>
2238 <MenuItem>Bar</MenuItem>
2239 <MenuItem>Baz</MenuItem>
2240 <MenuItem>Fizz</MenuItem>
2241 </MenuSection>
2242 </Menu>
2243 </Popover>
2244 </MenuTrigger>
2245 );
2246}
2247
2248function SelectionDynamic(props) {
2249 let {selectionMode = 'single'} = props;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected