Skip to main content

Function: update()

update(element): Promise<void>

Defined in: render.tsx:161

Updates the rendered React element tree.

Used primarily for hot module replacement (HMR) during development. Replaces the current component tree with a new element without reinitializing the GTK application.

Parameters

ParameterTypeDescription
elementReactNodeThe new root React element to render

Returns

Promise<void>

Example

// In HMR handler
if (import.meta.hot) {
import.meta.hot.accept(() => {
update(<App />);
});
}

See

render for initial rendering