Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

How does the SvelteKit form property work with client side rendering?

$
0
0

I'm having trouble accessing the result of my +page.server.ts actions function using the $page.form property when ssr is disabled, while the data prop from the load function is working fine. Is this a bug, or am I misunderstanding how the data is handled when using actions?

I'm trying to do something like this:

// routes/+page.svelte<form>    //...data</form>
// routes/folder/+page.server.tsexport const ssr = false;export const actions: Actions = {    default: async ({ request }) => {        // ...logic        return {value}     }}export const load  = async ({ cookies }) => {    //...logic    return {value}}
// routes/folder/+page.svelte<script>  export let data;  console.log(data); // null  export let form;  console.log(form); // value</script>

Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>