Closed as not planned
Closed as not planned
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- 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
Steps to Reproduce
- Open this code
- See the TypeScript error
- See that changing
Fragment
andHost
return type toVNode
fixes the issues
Code Reproduction URL
Additional Information
Related issue: #5306
Metadata
Metadata
Assignees
Labels
No labels