From 1.0.0-next.286 how to correctly type the Load function? #4141
Unanswered
frederikhors
asked this question in
Q&A
Replies: 1 comment 9 replies
-
There is breaking changes about type on 1.0.0-next.286. The <script context="module" lang="ts">
import type { LoadInput, LoadOutput } from "@sveltejs/kit/types/private";
export function load({ url }: LoadInput): LoadOutput {
//...
}
</script> I prefer using function expression because it simply import only <script lang="ts" context="module">
import type { Load } from '@sveltejs/kit'
export const load: Load = async ({ url }) => {
// url === URL
return {}
}
</script>
|
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
After upgrade from
1.0.0-next.285
to1.0.0-next.286
I have an error using this code:Now if I copy the code from https://kit.svelte.dev/docs/loading:
the
url
isany
.Why?
Am I wrong using it?
Beta Was this translation helpful? Give feedback.
All reactions