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

Function DefaultProvider

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

Source from the content-addressed store, hash-verified

390}
391// A Context.Provider that only sets a value if not inside SelectValue.
392function DefaultProvider({
393 context,
394 value,
395 children
396}: {
397 context: React.Context<any>;
398 value: any;
399 children: any;
400}) {
401 let inSelectValue = useContext(InsideSelectValueContext);
402 if (inSelectValue) {
403 return children;
404 }
405 return <context.Provider value={value}>{children}</context.Provider>;
406}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected