compiler
compiler copied to clipboard
🐛 BUG: using `as` a prop name cause Props to not be recognized in TSX
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
Compiler playground, having as as a prop breaks the Props recognition, could be related to https://github.com/withastro/compiler/issues/878 maybe?
This likely regressed in https://github.com/withastro/compiler/pull/817