Skip to content

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

@patrick91

Description

@patrick91

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P4: importantViolate documented behavior or significantly improves performance (priority)feat: tsxRelated to the TSX output (scope)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions