diff --git a/examples/svelte3/src/BindThis.story.svelte b/examples/svelte3/src/BindThis.story.svelte
new file mode 100644
index 00000000..3f663883
--- /dev/null
+++ b/examples/svelte3/src/BindThis.story.svelte
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+ button={button}
+ checkbox={checkbox}
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/histoire-plugin-svelte/src/client/util.ts b/packages/histoire-plugin-svelte/src/client/util.ts
index d77ee87e..9a715e5a 100644
--- a/packages/histoire-plugin-svelte/src/client/util.ts
+++ b/packages/histoire-plugin-svelte/src/client/util.ts
@@ -7,6 +7,9 @@ function cleanupState (state: Record): Record {
if (key === 'Hst') continue
const value = state[key]
if (typeof value === 'function') continue
+ if (typeof value === 'undefined') continue
+ if (value instanceof HTMLElement) continue
+ if (typeof value === 'object' && value.$$) continue
result[key] = value
}
return result
@@ -19,7 +22,7 @@ export function syncState (variantState, onChange: (state) => unknown) {
if (value == null) return
if (!syncing) {
syncing = true
- onChange(value)
+ onChange(cleanupState(value))
} else {
syncing = false
}