Types
JsxChild
JSX コンテンツ内の個々の要素を表すユニオン型
概要
JsxChild は、JSX コンテンツ内の個々の要素を表します。
type JsxChild = string | JsxElement | Variable;ユニオンのメンバー
| Type | 説明 | 
|---|---|
| string | プレーンテキスト | 
| JsxElement | 構造化要素 | 
| Variable | 動的プレースホルダー | 
例
基本的な型
import { JsxChild, Variable } from 'generaltranslation';
// String
const text: JsxChild = "ようこそ!";
// Variable
const name: JsxChild = { k: 'userName' } as Variable;
// Element
const link: JsxChild = {
  t: 'a',
  c: ['ここをクリック']
};関連する型
- JsxChildren- JsxChild 要素の集合
- JsxElement- 構造化要素
このガイドはどうでしたか?

