Skip to content

Spreads props does not work on <svelte:window /> #10314

Open
@minht11

Description

@minht11

Describe the bug

<script>
	let count = $state(0);

	function increment() {
		count += 1;
	}

	const listeners = {
		onclick: increment,
	}
</script>

<svelte:window {...listeners} />

clicks: {count}

When running code above, window click handler should be set, instead nothing happens.

In fact no code is generated at all so this either work or should be marked as an error.

Reproduction

Reproduction

Logs

No response

System Info

"svelte": "5.0.0-next.40",

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions