> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# Function: render()

> **render**\<`Q` _extends_ [`Queries`](/next/api/react/testing-library/Interfaces/Queries.md) = _typeof_ [`queries`](/next/api/react/testing-library/Namespaces/queries.md)>(`ui`: `ReactNode`, `options?`: [`RenderOptions`](/next/api/react/testing-library/Interfaces/RenderOptions.md)\<`Q`>): [`RenderResult`](/next/api/react/testing-library/Type_Aliases/RenderResult.md)\<`Q`>

Render into the page. It should be used with cleanup.

## Type Parameters

| Type Parameter                                                                   | Default type                                                                |
| -------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `Q` _extends_ [`Queries`](/next/api/react/testing-library/Interfaces/Queries.md) | _typeof_ [`queries`](/next/api/react/testing-library/Namespaces/queries.md) |

## Parameters

| Parameter  | Type                                                                                 |
| ---------- | ------------------------------------------------------------------------------------ |
| `ui`       | `ReactNode`                                                                          |
| `options?` | [`RenderOptions`](/next/api/react/testing-library/Interfaces/RenderOptions.md)\<`Q`> |

## Returns

[`RenderResult`](/next/api/react/testing-library/Type_Aliases/RenderResult.md)\<`Q`>

## Example

```ts
import { render} from '@lynx-js/react/testing-library'

const WrapperComponent = ({ children }) => (
    <view data-testid='wrapper'>{children}</view>
);
const Comp = () => {
  return <view data-testid='inner' style="background-color: yellow;" />;
};
const { container, getByTestId } = render(<Comp />, {
  wrapper: WrapperComponent,
});
expect(getByTestId('wrapper')).toBeInTheDocument();
expect(container.firstChild).toMatchInlineSnapshot(`
  <view
    data-testid="wrapper"
  >
    <view
      data-testid="inner"
      style="background-color: yellow;"
    />
  </view>
`);
```
