DEV Community

Discussion on: Getting form body data in SvelteKit actions/server pages

Collapse
 
myleftshoe profile image
myleftshoe

Don't know tbh, I don't use type script. Since Svelte has excellent typescript support it must be in the docs somewhere. :(

Thread Thread
 
xenogew profile image
Natta Wang • Edited

Thanks for your reply, it's ok, I got answer.

For those who might want to know, I'll leave it here

post({ request }: RequestEvent) {

Reason: it's destructure pattern, we need to specify type of object that will be passed to post function, and here we are looking for request property which is property of RequestEvent.

PS. RequestEvent is a type of Svelte Kit library.