Skip to content

[Svelte 5] Spread attributes not reactive when used with a function #9852

@adiguba

Description

@adiguba

Describe the bug

With Svelte 5, function calls in the template are reactive.

Basically these examples are reactive (if aFunctionCall() use a state) :

<div>{aFunctionCall()}</div>

or

<div class={aFunctionCall()}> ... </div>

But this is not the case for the spread attributes :

<div {...aFunctionCall()}> ... </div>

Reproduction

See REPL

Choose a color. The class attribute is not updated on the last div

Seem that the $.spread_attributes() call should be inside a $.render_effect()

Logs

No response

System Info

REPL

Severity

annoyance

Metadata

Metadata

Assignees

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