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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 BUG: using as a prop name cause Props to not be recognized in TSX #927

Open
patrick91 opened this issue Dec 26, 2023 · 2 comments
Open
Labels
- P4: important Violate documented behavior or significantly improves performance (priority) feat: tsx Related to the TSX output (scope)

Comments

@patrick91
Copy link

Describe the Bug

Having as as Prop gives this error: 'Props' is declared but never used`

here's a small reproduction

---
interface Props {
  as?: string;
  href?: string;
}

const { as: Component, href } = Astro.props;

const level = Component.replace("h", "");

const className = `typography-heading-${level}`;
---

<Component id={href.replace("#", "")}>
  <a href={href}>
    <slot />
  </a>
</Component>

Steps to Reproduce

using typescript and the strictest settings and then running build or astro check

@github-actions github-actions bot added the needs triage Issue needs to be triaged label Dec 26, 2023
@Princesseuh Princesseuh transferred this issue from withastro/language-tools Dec 26, 2023
@Princesseuh
Copy link
Member

Compiler playground, having as as a prop breaks the Props recognition, could be related to #878 maybe?

@Princesseuh Princesseuh changed the title 馃悰 BUG: using as a prop name makes 'Props' is declared but never used appear 馃悰 BUG: using as a prop name cause Props to not be recognized Dec 26, 2023
@Princesseuh Princesseuh added - P4: important Violate documented behavior or significantly improves performance (priority) feat: tsx Related to the TSX output (scope) and removed needs triage Issue needs to be triaged labels Dec 26, 2023
@Princesseuh Princesseuh changed the title 馃悰 BUG: using as a prop name cause Props to not be recognized 馃悰 BUG: using as a prop name cause Props to not be recognized in TSX Dec 26, 2023
@MoustaphaDev
Copy link
Member

This likely regressed in #817

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly improves performance (priority) feat: tsx Related to the TSX output (scope)
Projects
None yet
Development

No branches or pull requests

3 participants