Types
JsxChild
Union type representing individual elements in JSX content
Overview
JsxChild represents a single element within JSX content.
type JsxChild = string | JsxElement | Variable;Union Members
| Type | Description |
|---|---|
string | Plain text content |
JsxElement | Structured element |
Variable | Dynamic placeholder |
Examples
Basic types
import { JsxChild, Variable } from 'generaltranslation';
// String
const text: JsxChild = "Welcome!";
// Variable
const name: JsxChild = { k: 'userName' } as Variable;
// Element
const link: JsxChild = {
t: 'a',
c: ['Click here']
};Related types
JsxChildren- Collections of JsxChild elementsJsxElement- Structured elements
How is this guide?