Replies: 2 comments
-
This is currently possible through the form actions API. After sending a request to a form action, you can return data through the form property on the page. <script lang="ts">
import type { PageData, ActionData } from './$types';
export let data: PageData;
export let form: ActionData;
</script>
{#if form?.success}
<!-- this message is ephemeral; it exists because the page was rendered in
response to a form submission. it will vanish if the user reloads -->
<p>Successfully logged in! Welcome back, {data.user.name}</p>
{/if} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yes but this wont work with a redirect() method, so it can't be use as a global flash message system.... |
Beta Was this translation helpful? Give feedback.
0 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.
-
Are flash messages something that is ultimatly planed, or been discused ?
Or do we have to find a way to implement it by ourself ? ( i see there is already one library about it -> https://www.npmjs.com/package/sveltekit-flash-message )
thx
Beta Was this translation helpful? Give feedback.
All reactions