tailwindlabs / heroicons

A set of free MIT-licensed high-quality SVG icons for UI development.
https://heroicons.com
MIT License
21.45k stars 1.28k forks source link

Fix vue TypeScript declarations, again #549

Closed zmwangx closed 2 years ago

zmwangx commented 2 years ago

I'm not sure why DefineComponent was changed to RenderFunction in #322, but it has a wrong signature (returns VNodeChild instead of VNode) and is now causing #516 with newer versions of vue-tsc (allegedly, I didn't downgrade it to check):

  error TS2786: '...' cannot be used as a JSX component.
    Its return type 'VNodeChild' is not a valid JSX element.
      Type 'undefined' is not assignable to type 'Element | null'.

as documented in #516. So here we change RenderFunction back to DefineComponent.

zmwangx commented 2 years ago

Actually upon further investigation, VNodeChild only causes an error with vue-tsc@0.3.0, not newer versions, so I guess RenderFunction is okay. Just avoid the problematic version of vue-tsc.

amoslai5128 commented 2 years ago

@zmwangx I found the same error with vue-tst@0.30.0 version.