[vue3] - Accessing generically typed props in <script lang='ts' setup> causes transform failure. #10304
Closed
7 tasks done
Labels
bug: upstream
Bug in a dependency of Vite
Describe the bug
Firstly, apologies if it seems like this should be an issue in the Vue 3 repo. I can move it across if that's the case.
I am trying to create a reusable Vue 3 component with generically typed props.
Let's say I want a props interface that looks something like:
The goal of this is so that something like the below would fail:
Using this example, and also running into this issue I came up with the following:
This successfully results in the following:
Great, all working fine. That is, until I try and access the props in ChildComponent.vue...
As soon as I add
const props =
to then do some logic with the props, I get an error.The error I get is the following:
Reproduction
https://github.com/joemaylor/type-generic-props-repro
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: