preact#ComponentChildren TypeScript Examples
The following examples show how to use
preact#ComponentChildren.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: tr.tsx From gridjs with MIT License | 6 votes |
private getChildren(): ComponentChildren {
if (this.props.children) {
return this.props.children;
} else {
return (
<Fragment>
{this.props.row.cells.map((cell: Cell, i) => {
const column = this.getColumn(i);
if (column && column.hidden) return null;
return (
<TD
key={cell.id}
cell={cell}
row={this.props.row}
column={column}
/>
);
})}
</Fragment>
);
}
}
Example #2
Source File: VieraConfigUI.tsx From homebridge-vieramatic with Apache License 2.0 | 5 votes |
Template = (props: { children: ComponentChildren }) => (
<main className="align-items-center text-center align-content-center">{props.children}</main>
)
Example #3
Source File: markdown.tsx From obsidian-dataview with MIT License | 5 votes |
/** Render a simple nice looking error box in a code style. */
export function ErrorPre(props: { children: ComponentChildren }, {}) {
return <pre class="dataview dataview-error">{props.children}</pre>;
}