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

Force ArrayConstructor to be a any[] typescript type (fix #9935) #10074

Closed
wants to merge 1 commit into from

Conversation

Domino9697
Copy link

Issue

When using an Array prop in a Vue component with TypeScript, TypeScript breaks because the
JavaScript ArrayConstructor is transpiled to a {}[] typescript type that is for some reason more
general than any[]. Since the type is more general, the component is not using the correct component
overload function declaration. The idea here is to force the JavaScript ArrayConstructor to be
transpiled to any[] type to fix the issue.

fix #9935

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

The PR fulfills these requirements:

When using an Array prop in a Vue component with TypeScript, typescript breaks because the
JavaScript arrayconstructor is transpiled to a {}[] typescript type that is for some reason more
general than any[]. Since the type is more general, the component is not using the correct component
overload function declaration. The idea here is to force the JavaScript ArrayConstructor to be
transpiled to any[] type.

fix vuejs#9935
@ktsn
Copy link
Member

ktsn commented Aug 30, 2019

I don't think it is a good idea to modify our code to deal with TypeScript issue. In any case this issue is already fixed on TypeScript 3.5, so we can close the issue?

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.

Typing: Props not bound to this
3 participants