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

Function Provider

packages/@react-spectrum/s2/src/Provider.tsx:69–84  ·  view source on GitHub ↗
(props: ProviderProps)

Source from the content-addressed store, hash-verified

67 * It loads the font and sets the colorScheme, locale, and other application level settings.
68 */
69export function Provider(props: ProviderProps): JSX.Element {
70 let result = <ProviderInner {...props} />;
71 let parentColorScheme = useContext(ColorSchemeContext);
72 let colorScheme = props.colorScheme || parentColorScheme;
73 result = <ColorSchemeContext.Provider value={colorScheme}>{result}</ColorSchemeContext.Provider>;
74
75 if (props.locale) {
76 result = <I18nProvider locale={props.locale}>{result}</I18nProvider>;
77 }
78
79 if (props.router) {
80 result = <RouterProvider {...props.router}>{result}</RouterProvider>;
81 }
82
83 return result;
84}
85
86generateDefaultColorSchemeStyles();
87

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected