You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a component that creates a inline CSS variable from a given prop (and spreads the $$restProps) When the prop changes Expected the CSS variable is updated Actual the CSS variable does not update
The key here is "and spreads the $$restProps", if you remove this line, the issue does not occur anymore (see REPL)
I can't really be sure if this is the only particular case where this happens, but this is the scenario in which I'm able to replicate.
The toggle button should change the backgroundColor provided to the Box component. The Box component should create a CSS variable --bg-color and the background of the div should change.
In the current state of the REPL this does not work, but if you delete {...$$restProps} in the Box.svelte everything works as expected.
Yeah, but we actually want these to be passed as component props to be sure they are typed accordingly to our token types and to have a clear and concise API of what our component supports as customization.
Describe the bug
Given a component that creates a inline CSS variable from a given prop (and spreads the $$restProps)
When the prop changes
Expected the CSS variable is updated
Actual the CSS variable does not update
The key here is "and spreads the $$restProps", if you remove this line, the issue does not occur anymore (see REPL)
I can't really be sure if this is the only particular case where this happens, but this is the scenario in which I'm able to replicate.
Reproduction
I created this simple REPL to reproduce the issue:
https://svelte.dev/repl/906ddb7ef8f3436095ca0e401e0fe8b9?version=3.58.0
The toggle button should change the backgroundColor provided to the Box component. The Box component should create a CSS variable
--bg-color
and the background of the div should change.In the current state of the REPL this does not work, but if you delete
{...$$restProps}
in theBox.svelte
everything works as expected.Logs
No response
System Info
Severity
annoyance
Not sure what to put here, in our case is blocking the way we implemented some features.
The text was updated successfully, but these errors were encountered: