MCPcopy
hub / github.com/adobe/react-spectrum / Child

Function Child

packages/react-stately/test/utils/useControlledState.test.tsx:338–345  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

336 }
337
338 function Child(props) {
339 let [value, setValue] = useControlledState(props.value, props.defaultValue, props.onChange);
340 return (
341 <button data-testid="value" onClick={() => setValue(value + 1)}>
342 {value}
343 </button>
344 );
345 }
346
347 function TransitionButton({onClick}) {
348 let [isPending, startTransition] = React.useTransition();

Callers

nothing calls this directly

Calls 2

useControlledStateFunction · 0.90
setValueFunction · 0.50

Tested by

no test coverage detected