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

Function DefaultProvider

packages/@react-spectrum/s2/src/Picker.tsx:849–864  ·  view source on GitHub ↗
({
  context,
  value,
  children
}: {
  context: React.Context<any>;
  value: any;
  children: any;
})

Source from the content-addressed store, hash-verified

847
848// A Context.Provider that only sets a value if not inside SelectValue.
849function DefaultProvider({
850 context,
851 value,
852 children
853}: {
854 context: React.Context<any>;
855 value: any;
856 children: any;
857}) {
858 let inSelectValue = useContext(InsideSelectValueContext);
859 if (inSelectValue) {
860 return children;
861 }
862
863 return <context.Provider value={value}>{children}</context.Provider>;
864}
865
866export interface PickerSectionProps<T> extends Omit<
867 ListBoxSectionProps<T>,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected