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

Function onChange

packages/react-aria/src/checkbox/useCheckboxGroupItem.ts:49–59  ·  view source on GitHub ↗
(isSelected)

Source from the content-addressed store, hash-verified

47 isSelected: state.isSelected(props.value),
48 defaultSelected: state.defaultValue.includes(props.value),
49 onChange(isSelected) {
50 if (isSelected) {
51 state.addValue(props.value);
52 } else {
53 state.removeValue(props.value);
54 }
55
56 if (props.onChange) {
57 props.onChange(isSelected);
58 }
59 }
60 });
61
62 let {name, form, descriptionId, errorMessageId, validationBehavior} =

Callers

nothing calls this directly

Calls 2

addValueMethod · 0.80
removeValueMethod · 0.80

Tested by

no test coverage detected