This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tiny JSX renderer in TypeScript inspired by plain-jxs: https://github.com/callumlocke/plain-jsx | |
// Babel would allow you to specify the factory function as special inline comment: | |
/** @jsx JSXrender */ | |
let JSXrender = (tagName: string, attributes?: { [key: string]: any }, ...children: Array<HTMLElement | string>): HTMLElement => { | |
if (!tagName || typeof tagName !== 'string') | |
throw new Error("tagName has to be defined, non-empty string"); |