You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched for existing issues that already report this problem, without success.
Stencil Version
4.12.0
Current Behavior
After #5306 is resolved, typescript is able to correctly resolve JSX.Element type (before that, it's implicitly any)
That uncovers another error in the typings - Fragment and Host are typed as returning VNode | VNode[], but should return VNode
This manifests as the following TypeScript errors:
'Host'cannot be used as a JSX component.Its return type 'VNode | VNode[]' is not a valid JSX element.ts(2786)/// and:
'Fragment'cannot be used as a JSX component.Its return type 'VNode | VNode[]' is not a valid JSX element.Type 'VNode[]' is missing the following properties from type 'VNode': $flags$, $tag$, $elm$, $text$, $children$ts(2786)
Expected Behavior
The return type should be VNode to resolve the errors
System Info
System: node 20.11.0
Platform: darwin (23.2.0)
CPU Model: Apple M1 Pro (10 cpus)
Compiler: /Users/mak13180/site/esri/arcgis-web-components/node_modules/@stencil/core/compiler/stencil.js
Build: 1705333241
Stencil: 4.10.0 🍪
TypeScript: 5.3.3
Rollup: 2.42.3
Parse5: 7.1.2
jQuery: 4.0.0-pre
Terser: 5.26.0
Prerequisites
Stencil Version
4.12.0
Current Behavior
After #5306 is resolved, typescript is able to correctly resolve
JSX.Elementtype (before that, it's implicitly any)That uncovers another error in the typings -
FragmentandHostare typed as returningVNode | VNode[], but should returnVNodeThis manifests as the following TypeScript errors:
Expected Behavior
The return type should be
VNodeto resolve the errorsSystem Info
System: node 20.11.0 Platform: darwin (23.2.0) CPU Model: Apple M1 Pro (10 cpus) Compiler: /Users/mak13180/site/esri/arcgis-web-components/node_modules/@stencil/core/compiler/stencil.js Build: 1705333241 Stencil: 4.10.0 🍪 TypeScript: 5.3.3 Rollup: 2.42.3 Parse5: 7.1.2 jQuery: 4.0.0-pre Terser: 5.26.0Steps to Reproduce
FragmentandHostreturn type toVNodefixes the issuesCode Reproduction URL
https://typescript-eslint.io/play/#ts=5.3.3&showAST=types&fileType=.tsx&code=KYDwDg9gTgLgBASwHY2FA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