File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
src/transformation/visitors Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -288,7 +288,8 @@ export const transformCallExpression: FunctionVisitor<ts.CallExpression> = (node
288288 calledExpression ,
289289 node . arguments ,
290290 signature ,
291- callContext
291+ // Only pass context if noImplicitSelf is not configured
292+ context . options . noImplicitSelf ? undefined : callContext
292293 ) ;
293294 }
294295
Original file line number Diff line number Diff line change @@ -288,6 +288,18 @@ describe("jsx", () => {
288288 . addExtraFile ( "myJsx.ts" , customJsxLib )
289289 . expectToMatchJsResult ( ) ;
290290 } ) ;
291+ test ( "custom JSX factory with noImplicitSelf" , ( ) => {
292+ testJsx `
293+ return <a><b>c</b></a>
294+ `
295+ . setTsHeader (
296+ `function createElement(tag: string | Function, props: { [key: string]: string | boolean }, ...children: any[]) {
297+ return { tag, children };
298+ }`
299+ )
300+ . setOptions ( { jsxFactory : "createElement" , noImplicitSelf : true } )
301+ . expectToMatchJsResult ( ) ;
302+ } ) ;
291303 test ( "custom fragment factory" , ( ) => {
292304 testJsx `
293305 return <><b>c</b></>
You can’t perform that action at this time.
0 commit comments