vanjs-org / mini-van

Mini-Van: A minimalist template engine for DOM generation and manipulation, working for both client-side and server-side rendering (SSR)

Home Page:https://vanjs.org/minivan

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TS2345 type error when passing `undefined` to a HTML prop/attribute

btakita opened this issue · comments

import van from 'mini-van-plate'
const { a }  = van.tags
a({ id: undefined })

results in a TS2345 error

TS2345: Argument of type  { id:undefined; }  is not assignable to parameter of type  ChildDom<Element, Text>|Props 
Type  { id:undefined; }  is not assignable to type  undefined

I think this is an intended behavior in VanJS. See vanjs-org/van#39 (comment) for relevant discussion.

Thank you. Going to comment on that issue.