Per-file JSX factories

TypeScript 2.8 adds support for a per-file configurable JSX factory name using @jsx dom paragma.JSX factory can be configured for a compilation using —jsxFactory (default is React.createElement). With TypeScript 2.8 you can override this on a per-file-basis by adding a comment to the beginning of the file.

Example

  1. /** @jsx dom */
  2. import { dom } from "./renderer"
  3. <h></h>

Generates:

  1. var renderer_1 = require("./renderer");
  2. renderer_1.dom("h", null);