JSX Factory function. In order for this function to be invoked by the TypeScript compiler, the
tsconfig.json file must have the following options:
"compilerOptions":
{
"jsx": "react",
"jsxFactory": "mim.jsx",
"jsxFragmentFactory": "mim.Fragment"
}
The .tsx files must import the mimbl module as mim:
import * as mim from "mimbl"
This ensures that you have the mim.jsx function in scope even though it is usually not used
explicitly.
An artificial
Fragmentcomponent that is only used as a temporary collection of other items in places where JSX only allows a single item. Our JSX factory function creates a virtual node for each of its children and the function is never actually called.The
Fragmentcomponent can be used directly; however, the better way is to set thejsxFragmentFactorycompiler option in thetsconfig.jsonfile tomim.Fragmentand use the TypeScripts<>...</>construct as in the following example:Note that you must have the
mim.Fragmentfunction in scope (usingimport * as mim from "mimbl") even though it is not used explicitly.