Skip to content

API Reference / @gtkx/testing / render

Variable: render

const render: <Q>(element, options?) => Promise<RenderResult<Q>>

Defined in: render.d.ts:13

Renders a React element into a GTK4 widget tree and returns queries scoped to it along with controls for rerendering and unmounting. When no container is supplied, a harness window is created and presented.

Type Parameters

Q

Q extends QueryMap = Record<never, never>

Parameters

element

ReactNode

The React element to render.

options?

RenderOptions<Q>

Optional container, wrapper, custom queries, and other render settings.

Returns

Promise<RenderResult<Q>>

A render result with bound queries, debug helpers, and lifecycle controls.

Released under the MPL-2.0 License.