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

Function Child

packages/react-aria-components/test/ListBox.test.js:353–366  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

351 let setShowTwo;
352 let setItemText;
353 function Child() {
354 let [showTwo, _setShowTwo] = useState(false);
355 let [itemText, _setItemText] = useState('One');
356 useEffect(() => {
357 setItemText = _setItemText;
358 setShowTwo = _setShowTwo;
359 }, [_setItemText, _setShowTwo]);
360 return (
361 <>
362 <ListBoxItem id={1}>{itemText}</ListBoxItem>
363 {showTwo && <ListBoxItem id={2}>Two</ListBoxItem>}
364 </>
365 );
366 }
367
368 let {getAllByRole} = render(
369 <ListBox aria-label="Example">

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected