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

Cannot use <component> with variable "is" prop #2734

Closed
mtorromeo opened this issue Apr 27, 2023 · 1 comment
Closed

Cannot use <component> with variable "is" prop #2734

mtorromeo opened this issue Apr 27, 2023 · 1 comment
Labels
duplicate This issue or pull request already exists good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@mtorromeo
Copy link

When trying to assign a dynamic tag to the is prop of <component> I get the error:

error TS2345: Argument of type '{}' is not assignable to parameter of type 'string & Record<string, unknown>'.
  Type '{}' is not assignable to type 'string'.

Minimal reproduction component:

<script lang="ts" setup>
const tag = 'label';
</script>

<template>
  <component :is="tag">test</component>
// ^^^^^^^^^ Type '{}' is not assignable to type 'string'.
</template>

Stackblitz

@johnsoncodehk
Copy link
Member

Duplicate of #2725

@johnsoncodehk johnsoncodehk marked this as a duplicate of #2725 Apr 27, 2023
@johnsoncodehk johnsoncodehk closed this as not planned Won't fix, can't repro, duplicate, stale Apr 27, 2023
@johnsoncodehk johnsoncodehk added duplicate This issue or pull request already exists good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

No branches or pull requests

2 participants