Remove "as Props" from the astro examples (#4494)
This commit is contained in:
parent
b3db2c3c4b
commit
5fbb359afb
8 changed files with 8 additions and 8 deletions
|
@ -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">
|
||||
|
|
|
@ -3,7 +3,7 @@ export interface Props {
|
|||
title: string;
|
||||
}
|
||||
|
||||
const { title } = Astro.props as Props;
|
||||
const { title } = Astro.props;
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
|
|
@ -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;
|
||||
---
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ export interface Props {
|
|||
|
||||
const {
|
||||
content: { title, description, pubDate, updatedDate, heroImage },
|
||||
} = Astro.props as Props;
|
||||
} = Astro.props;
|
||||
---
|
||||
|
||||
<html>
|
||||
|
|
|
@ -5,7 +5,7 @@ export interface Props extends Record<any, any> {
|
|||
|
||||
const { type, ...props } = {
|
||||
...Astro.props,
|
||||
} as Props;
|
||||
};
|
||||
|
||||
props.type = type || 'button';
|
||||
---
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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} }`}>
|
||||
|
|
|
@ -6,7 +6,7 @@ export interface Props {
|
|||
title: string;
|
||||
}
|
||||
|
||||
const { title } = Astro.props as Props;
|
||||
const { title } = Astro.props;
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
|
Loading…
Reference in a new issue