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

Function useFormProps

packages/@adobe/react-spectrum/src/form/Form.tsx:71–78  ·  view source on GitHub ↗
(props: T)

Source from the content-addressed store, hash-verified

69
70let FormContext = React.createContext<FormContextValue | null>(null);
71export function useFormProps<T extends SpectrumLabelableProps>(props: T): T {
72 let ctx = useContext(FormContext);
73 if (ctx) {
74 return {...ctx, ...props};
75 }
76
77 return props;
78}
79
80const formPropNames = new Set([
81 'action',

Callers 15

ComboBox.tsxFile · 0.90
SearchField.tsxFile · 0.90
CheckboxGroup.tsxFile · 0.90
Checkbox.tsxFile · 0.90
NumberField.tsxFile · 0.90
Picker.tsxFile · 0.90
Field.tsxFile · 0.90
SearchAutocompleteFunction · 0.90
RadioGroup.tsxFile · 0.90
ColorField.tsxFile · 0.90
TextField.tsxFile · 0.90
TextArea.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected