Skip to content

snapshot example is not working #1921

@abdul-saqib

Description

@abdul-saqib

Description

Here, the snapshot example is not broken. However, if I fill out the form and refresh the page, the values are lost.

Minimal Reproduction

<script lang="ts">
	import type { Snapshot } from './$types';

	let comment = $state('');

	export const snapshot: Snapshot<string> = {
		capture: () => comment,
		restore: (value) => comment = value
	};
</script>

<form method="POST">
	<label for="comment">Comment</label>
	<textarea id="comment" bind:value={comment} />
	<button>Post comment</button>
</form>

Steps to Reproduce

You can check this example
https://flowbite-svelte.com/docs/examples/snapshot

Environment

Demo Site
https://flowbite-svelte.com/docs/examples/snapshot

Relevant Logs / Console Output

Screenshots / GIF (optional)

No response

Additional Context (optional)

No response

Checklist

  • I have searched existing issues and discussions
  • I have provided a minimal and runnable reproduction
  • I am using the latest version of Flowbite-Svelte

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions