classExampleComponent{render(){return<app-example><app-child></app-child></app-example>;}customCreateElement(tagName: string,attributes: {[name: string]: any}, ...children: []){// ... create something in the dom or whatever}}
🙁 Actual behavior
TypeScripts emits the correct code with the this references (this.customCreateElement("app-example", null, this.customCreateElement("app-child", null));), but still throws an error:
index.tsx:3:17 - error TS2304: Cannot find name 'this'.
3 return <app-example>
~~~~~~~~~~~
index.tsx:4:14 - error TS2304: Cannot find name 'this'.
4 <app-child></app-child>
~~~~~~~~~
Found 2 errors in the same file, starting at: index.tsx:3
🙂 Expected behavior
The output stays the same - but there is no error message.
The text was updated successfully, but these errors were encountered:
I'd love to contribute myself, is there a starting point / do you know somewhere where I should start digging. I've already checked out the code and got it running!
Bug Report
I would like to create my own JSX-Factory which references
this, for examplethis.createElement.Custom JSX factory, this in jsx factory
Tested on Version 4.7.2 and Version 4.8.0-dev.20220524 (@next).
Sadly, playground does not support the
jsxFactorytsconfig field, thus this can't be shown in playground.{ "compilerOptions": { "jsx": "react", "jsxFactory": "this.customCreateElement" } }TypeScripts emits the correct code with the this references (
this.customCreateElement("app-example", null, this.customCreateElement("app-child", null));), but still throws an error:The output stays the same - but there is no error message.
The text was updated successfully, but these errors were encountered: