Types
JsxChildren
Type definition for JSX content that can be translated and rendered
Overview
JsxChildren represents JSX content containing text, elements, and variables for translation.
type JsxChildren = JsxChild | JsxChild[];Structure
type JsxChild = string | JsxElement | Variable;| Type | Description | 
|---|---|
| string | Plain text content | 
| JsxElement | Structured element | 
| Variable | Dynamic placeholder | 
JsxElement
type JsxElement = {
  t?: string;      // tag name
  i?: number;      // id  
  d?: GTProp;      // GT properties
  c?: JsxChildren; // children
};Examples
Basic Usage
import { JsxChildren, Variable } from 'generaltranslation';
// Simple text
const text: JsxChildren = "Welcome!";
// Text with variables
const greeting: JsxChildren = [
  "Hello, ",
  { k: 'userName' } as Variable,
  "!"
];Structured Elements
// Div element
const divElement: JsxChildren = {
  t: 'div',
  c: ['Content here']
};
// Link with title
const linkElement: JsxChildren = {
  t: 'a',
  d: { ti: 'Visit homepage' },
  c: ['Click here']
};Related Types
- JsxChild- Individual child element types
- JsxElement- Structured element definitions
How is this guide?

