summaryrefslogtreecommitdiff
path: root/docs/src
diff options
context:
space:
mode:
Diffstat (limited to 'docs/src')
-rw-r--r--docs/src/pages/core-concepts/astro-components.md7
1 files changed, 5 insertions, 2 deletions
diff --git a/docs/src/pages/core-concepts/astro-components.md b/docs/src/pages/core-concepts/astro-components.md
index 1f1ae9a4a..84715de7d 100644
--- a/docs/src/pages/core-concepts/astro-components.md
+++ b/docs/src/pages/core-concepts/astro-components.md
@@ -167,17 +167,20 @@ const { greeting = 'Hello', name } = Astro.props;
</div>
```
-You can define your props with TypeScript by exporting a `Props` type interface.
+You can define your props with TypeScript by exporting a `Props` type interface. Astro will automatically pick up any exported `Props` interface and give type warnings/errors for your project.
-> _**In the future**_, Astro will automatically pick up any exported `Props` interface and give type warnings/errors for your project.
+Make sure to keep all `import` and `export` statements at the top of the component, before any other JavaScript or TypeScript logic!
```astro
---
+// include any `import` and `export` statements first
// Example: <SomeComponent /> (WARNING: "name" prop is required)
export interface Props {
name: string;
greeting?: string;
}
+
+// with `import`s and `export`s out of the way, include the rest of the component logic here
const { greeting = 'Hello', name } = Astro.props;
---
<div>
59&id=bbff5b77358151c7e203cb4f9278aa17f284cde9&follow=1'>Update quickstartGravatar Colin McDonnell 1-0/+19 2023-09-20Update prisma guideGravatar Colin McDonnell 1-0/+6 2023-09-20Update env docGravatar Colin McDonnell 1-1/+1 2023-09-20Clarify hot modeGravatar Colin McDonnell 1-10/+9 2023-09-20[bun install] Add `-E` as alias of `--exact` (#5104)Gravatar Jonah Snider 2-2/+57 * [bun install] Add `-E` as alias of `--exact` * Add test for -E flag 2023-09-20feat: switch disableTelemetry to bunfig (#5690)Gravatar Lucas Coratger 3-1/+14 * feat: switch disableTelemetry to bunfig * feat: zig fmt * revert: the env variable and invert the logic of telemetry --------- Co-authored-by: MrPalixir <73360179+MrPalixir@users.noreply.github.com> 2023-09-20Treat `undefined` value as empty in expect.toThrow (#5788)Gravatar LongYinan 1-3/+3 Fix: https://github.com/napi-rs/napi-rs/blob/main/examples/napi/__tests__/test.framework.js#L16-L19 2023-09-20Fix various bugs in vscode extension (#5772)Gravatar JeremyFunk 3-9/+85 * Fix bugs * Fix bugs * Revert "Fix bugs" This reverts commit 608639eb2214fdf4310477051ce47d20702b5dd0. 2023-09-20add `emitDecoratorMetadata` (#5777)Gravatar Dylan Conway 19-110/+1884 * some progess * needs more tests * make tests easier to debug * get metadata for constructor arg decorators * fix some things * merge `emitDecoratorMetadata` option * remove `^` * bundler tests and get option from tsconfig earlier * remove spaces * fix tests 2023-09-20fix(doc): correct `server.reload` (#5799)Gravatar Ai Hoshino 1-1/+1 2023-09-20Call `Error.prepareStackTrace` on `new Error().stack` (#5802)Gravatar Jarred Sumner 6-155/+277 * Always call `Error.prepareStackTrace` * Support node:vm * Remove this * Handle more cases --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-09-20Fixes #5800Gravatar Jarred Sumner 1-1/+1 Fixes #5800 2023-09-20Fix path used in bunx (#5785)Gravatar Jarred Sumner 2-26/+51 * Fix path used in bunx * Add test * Use a different package --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-09-20Fix RedirectURLTooLong errors (#5786)Gravatar ggobbe 1-1/+1 The URL to download the manifest for Artifact Registry in Google is larger than 4092 bytes. cf. issue #4748 2023-09-19Show when a newer version is available in the install screen (#5780)Gravatar Jarred Sumner 3-14/+95 Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-09-19Fix broken linksGravatar Colin McDonnell 4-4/+4