Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix vue TypeScript declarations, again #549

Conversation

zmwangx
Copy link
Contributor

@zmwangx zmwangx commented Nov 23, 2021

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.

RenderFunction has the wrong signature, causing

  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 tailwindlabs#516.

This commit reverts 1658f7c.
@zmwangx
Copy link
Contributor Author

zmwangx commented Nov 23, 2021

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.

@zmwangx zmwangx closed this Nov 23, 2021
@amoslai5128
Copy link

amoslai5128 commented Dec 22, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants