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

Having prop named "as", makes other properties any #9826

Closed
1 task
minht11 opened this issue Jan 25, 2024 · 1 comment
Closed
1 task

Having prop named "as", makes other properties any #9826

minht11 opened this issue Jan 25, 2024 · 1 comment
Labels
needs triage Issue needs to be triaged

Comments

@minht11
Copy link
Contributor

minht11 commented Jan 25, 2024

Astro Info

"astro": "^4.1.2",

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Having astro component with Prop named as breaks typechecking.

---
interface Props {
	as: 'string'
	title: string;
}

const { title } = Astro.props;
---
<div />

title becomes any, removing as fixes it. Likely somehow typescript as keyword clashes with prop. This worked fine with astro 3.

What's the expected result?

Things should work.

Link to Minimal Reproducible Example

https://codesandbox.io/p/devbox/weathered-sky-vsfkw3?file=%2Fsrc%2Fcomponents%2FCard.astro%3A4%2C16

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Jan 25, 2024
@Princesseuh
Copy link
Member

Duplicate of withastro/compiler#927

@Princesseuh Princesseuh marked this as a duplicate of withastro/compiler#927 Jan 25, 2024
@Princesseuh Princesseuh closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants