Skip to content

Commit

Permalink
Remove "as Props" from the astro examples (#4494)
Browse files Browse the repository at this point in the history
  • Loading branch information
the-dijkstra committed Aug 26, 2022
1 parent b3db2c3 commit 5fbb359
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/basics/src/components/Card.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
2 changes: 1 addition & 1 deletion examples/basics/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export interface Props {
title: string;
}
const { title } = Astro.props as Props;
const { title } = Astro.props;
---

<!DOCTYPE html>
Expand Down
2 changes: 1 addition & 1 deletion examples/blog/src/components/HeaderLink.astro
Original file line number Diff line number Diff line change
@@ -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;
---

Expand Down
2 changes: 1 addition & 1 deletion examples/blog/src/layouts/BlogPost.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface Props {
const {
content: { title, description, pubDate, updatedDate, heroImage },
} = Astro.props as Props;
} = Astro.props;
---

<html>
Expand Down
2 changes: 1 addition & 1 deletion examples/component/packages/my-component/Button.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface Props extends Record<any, any> {
const { type, ...props } = {
...Astro.props,
} as Props;
};
props.type = type || 'button';
---
Expand Down
2 changes: 1 addition & 1 deletion examples/component/packages/my-component/Heading.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-alpine/src/components/Counter.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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} }`}>
Expand Down
2 changes: 1 addition & 1 deletion examples/with-nanostores/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface Props {
title: string;
}
const { title } = Astro.props as Props;
const { title } = Astro.props;
---

<!DOCTYPE html>
Expand Down

0 comments on commit 5fbb359

Please sign in to comment.