Remove "as Props" from the astro examples (#4494)

This commit is contained in:
Mohammed Elhaouari 2022-08-26 15:16:17 +01:00 committed by GitHub
parent b3db2c3c4b
commit 5fbb359afb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 8 additions and 8 deletions

View file

@ -5,7 +5,7 @@ export interface Props {
href: string;
}
const { href, title, body } = Astro.props as Props;
const { href, title, body } = Astro.props;
---
<li class="link-card">

View file

@ -3,7 +3,7 @@ export interface Props {
title: string;
}
const { title } = Astro.props as Props;
const { title } = Astro.props;
---
<!DOCTYPE html>

View file

@ -1,7 +1,7 @@
---
export interface Props extends astroHTML.JSX.AnchorHTMLAttributes {}
const { href, class: className, ...props } = Astro.props as Props;
const { href, class: className, ...props } = Astro.props;
const isActive = href === Astro.url.pathname;
---

View file

@ -15,7 +15,7 @@ export interface Props {
const {
content: { title, description, pubDate, updatedDate, heroImage },
} = Astro.props as Props;
} = Astro.props;
---
<html>

View file

@ -5,7 +5,7 @@ export interface Props extends Record<any, any> {
const { type, ...props } = {
...Astro.props,
} as Props;
};
props.type = type || 'button';
---

View file

@ -6,7 +6,7 @@ export interface Props extends Record<any, any> {
const { level, role, ...props } = {
...Astro.props,
} as Props;
};
props.role = role || 'heading';
props['aria-level'] = level || '1';

View file

@ -6,7 +6,7 @@ export interface Props {
initialCount?: number;
}
const { initialCount = 0 } = Astro.props as Props;
const { initialCount = 0 } = Astro.props;
---
<div class="counter" x-data={`{ count: ${initialCount} }`}>

View file

@ -6,7 +6,7 @@ export interface Props {
title: string;
}
const { title } = Astro.props as Props;
const { title } = Astro.props;
---
<!DOCTYPE html>