Custom JSX factories using —reactNamespace

Passing —reactNamespace <JSX factory Name> along with —jsx react allows for using a different JSX factory from the default React.

The new factory name will be used to call createElement and __spread functions.

Example
  1. import {jsxFactory} from "jsxFactory";
  2. var div = <div>Hello JSX!</div>

Compiled with:

  1. tsc --jsx react --reactNamespace jsxFactory --m commonJS

Results in:

  1. "use strict";
  2. var jsxFactory_1 = require("jsxFactory");
  3. var div = jsxFactory_1.jsxFactory.createElement("div", null, "Hello JSX!");