diff options
author | 2021-06-24 17:48:24 -0500 | |
---|---|---|
committer | 2021-06-24 17:48:24 -0500 | |
commit | a136c85e6b2b0445e48184595b2696994621c8f1 (patch) | |
tree | 4d06743cf5b0e3f8f5dabcd1c8ae9e8b9b4557b2 /examples/blog/src/components/PostPreview.astro | |
parent | bc9e0f180ccec7d48fde49c857188543e007bf14 (diff) | |
download | astro-a136c85e6b2b0445e48184595b2696994621c8f1.tar.gz astro-a136c85e6b2b0445e48184595b2696994621c8f1.tar.zst astro-a136c85e6b2b0445e48184595b2696994621c8f1.zip |
New Props API (#515)
* wip: update props api
* feat(#139, #309): enable new props api
* chore: migrate examples to new props API
* docs: update syntax guide for new props API
* chore: update examples to new props API
* chore: update docs to new Props API
* fix: hide __astroInternal from `Astro.props` consumers
* chore: remove scratchpad file
* chore: fix script error
* test: fix failing collection tests
* fix: set __astroInternal to `enumerable: false`
* chore: add changeset
* feat: warn users using old props api
Diffstat (limited to 'examples/blog/src/components/PostPreview.astro')
-rw-r--r-- | examples/blog/src/components/PostPreview.astro | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/blog/src/components/PostPreview.astro b/examples/blog/src/components/PostPreview.astro index d02a23fe6..b126ca2fb 100644 --- a/examples/blog/src/components/PostPreview.astro +++ b/examples/blog/src/components/PostPreview.astro @@ -1,6 +1,9 @@ --- -export let post; -export let author; +export interface Props { + post: any; + author: string; +} +const { post, author } = Astro.props; function formatDate(date) { return new Date(date).toUTCString().replace(/(\d\d\d\d) .*/, '$1'); // remove everything after YYYY |