INNER CODE UNIT · TypeScript
createFactory
infernojs/inferno · packages/inferno-compat/src/index.ts:409
function createFactory<T extends Element = Element>(
type: string,
): ElementFactory<Record<string, unknown>, T>;
function createFactory<P>(type: ComponentType<P>): ElementFactory<P, unknown>;
function createFactory(type) {
return createElement.bind(null, type);
}
// Returns the root component instance, T is its class
function render<T extends JSX.ElementClass = Component>(
rootInput,
container,
cb: (() => void) | null = null,
context = EMPTY_OBJ,
): T | undefined {
renderInternal(rootInput, container, cb, context);
const input = container.$V;