Function: render()
render(
element,appId,flags?):void
Defined in: render.tsx:107
Renders a React element tree into a GTK4 application window.
This is the main entry point for GTKX applications. It initializes the GTK4 runtime, creates an application container, and begins the React reconciliation process.
Parameters
| Parameter | Type | Description |
|---|---|---|
element | ReactNode | The root React element to render |
appId | string | Application ID in reverse domain notation (e.g., "com.example.myapp") |
flags? | ApplicationFlags | Optional GIO application flags for customizing behavior |
Returns
void
Example
import { render, quit } from "@gtkx/react";
const App = () => (
<GtkApplicationWindow title="My App" onClose={quit}>
<GtkLabel label="Hello, GTKX!" />
</GtkApplicationWindow>
);
render(<App />, "com.example.myapp");