Hi,
I am trying to compile JSX with custom jsxFactory pointing to createElement function.
TypeScriptToLua generates extra nil parameter in the output:
test_jsx.ts:
function createElement(tag: string | Function, props: { [key: string]: string | boolean }, ...children: any[]) {
return "whatever, just testing";
}
function testJsx() {
return <div></div>
}
test_jsx.lua:
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
function createElement()
return "whatever"
end
function testJsx()
return createElement(nil, "div", nil)
end
I would expect that it would generate this:
return createElement("div", nil);
I have noImplicitSelf in tsconfig, and I also tried setting /** @noSelf */ attribute, but both of these are ignored.
tsconfig.json:
{
"compilerOptions": {
"target": "esnext",
"lib": [
"esnext"
],
"jsx": "react",
"jsxFactory": "createElement",
"moduleResolution": "node",
"types": ["lua-types/jit"],
"strict": true,
"outDir": "build"
},
"tstl": {
"luaTarget": "JIT",
"noImplicitSelf": true
}
}
Hi,
I am trying to compile JSX with custom
jsxFactorypointing tocreateElementfunction.TypeScriptToLua generates extra
nilparameter in the output:test_jsx.ts:
test_jsx.lua:
I would expect that it would generate this:
I have
noImplicitSelfin tsconfig, and I also tried setting/** @noSelf */attribute, but both of these are ignored.tsconfig.json:
{ "compilerOptions": { "target": "esnext", "lib": [ "esnext" ], "jsx": "react", "jsxFactory": "createElement", "moduleResolution": "node", "types": ["lua-types/jit"], "strict": true, "outDir": "build" }, "tstl": { "luaTarget": "JIT", "noImplicitSelf": true } }