Types

JsxChild

Union type representing individual elements within JSX content

Overview

JsxChild represents a single element within JSX content.

type JsxChild = string | JsxElement | Variable;

Union Members

TypeDescription
stringPlain text content
JsxElementStructured element
VariableDynamic 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']
};

How is this guide?

JsxChild