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

Function render

packages/@react-spectrum/s2/test/utils/render.tsx:29–42  ·  view source on GitHub ↗
(ui: ReactElement, options: S2RenderOptions = {})

Source from the content-addressed store, hash-verified

27 * Uses vitest-browser-react for browser mode testing.
28 */
29export async function render(ui: ReactElement, options: S2RenderOptions = {}) {
30 const {providerOptions = {}} = options;
31 const {locale = 'en-US', colorScheme = 'light', ...restProviderOptions} = providerOptions;
32
33 function Wrapper({children}: {children: React.ReactNode}) {
34 return (
35 <Provider locale={locale} colorScheme={colorScheme} {...restProviderOptions}>
36 {children}
37 </Provider>
38 );
39 }
40
41 return await vitestBrowserRender(<Wrapper>{ui}</Wrapper>);
42}

Calls

no outgoing calls

Tested by 1

renderTagGroupFunction · 0.40