[bug] type checking of ElementChildrenAttribute failed with JsxVNodeChildren
TechQuery opened this issue · comments
Example
JSX declaration
import { VNode, JsxVNodeChildren } from 'snabbdom';
declare global {
namespace JSX {
type Element = VNode;
interface ElementChildrenAttribute {
defaultSlot: JsxVNodeChildren;
}
}
}
JSX code
<section>
<h2>xxx</h2>
{[1, 2, 3].map(value => <span>{value}</span>)}
{/* Type 'VNode[]' is not assignable to type 'JsxVNodeChild'. ts(2322) */}
</section>
Context
Environment
- SnabbDOM: 3.5.0
- TypeScript: 4.7.3
You should not need any JSX declaration, snabbdom already provides these
But WebCell has more property types for DOM & Component node, and SnabbDOM's h()
& Fragment()
are not fulfilled all my situations, so I need some wrappers.