You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Throughout the examples above, we've been importing types from a `$types.d.ts` file. This is a file SvelteKit creates for you in a hidden directory if you're using TypeScript (or JavaScript with JSDoc type annotations) to give you type safety when working with your root files.
395
395
396
-
For example, annotating `let { data } =$props()` with `PageProps` tells TypeScript that the type of `data` is whatever was returned from `load`:
396
+
For example, annotating `let { data } =$props()` with `PageProps`(or `LayoutProps`, for a `+layout.svelte` file) tells TypeScript that the type of `data` is whatever was returned from `load`:
@@ -404,7 +404,7 @@ For example, annotating `let { data } = $props()` with `PageProps` tells TypeScr
404
404
```
405
405
406
406
> [!NOTE]
407
-
> The `PageProps` and `LayoutProps` types, added in 2.16.0, are a shortcut for typing the `data` prop as `PageData` or `LayoutData`, as well as other props, such as `form` for pages, or `children` for layouts. In earlier versions, you can type these properties manually, for example for a page:
407
+
> The `PageProps` and `LayoutProps` types, added in 2.16.0, are a shortcut for typing the `data` prop as `PageData` or `LayoutData`, as well as other props, such as `form` for pages, or `children` for layouts. In earlier versions, you had to type these properties manually. For example, for a page:
0 commit comments