-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Open
Milestone
Description
Describe the bug
There is this special syntax prop="{value}"
that does not cause string interpolation but instead just passes the value of the expression as is. This is inconsistent with how properties and string interpolation behave in all other cases.
As I see it, as soon as quotes are used, the value should be an interpolated string, no magic. Obviously, this would be a significant breaking change, so this is more of a suggestion for the future.
Reproduction
<Child value="42" /> <!-- string -->
<Child value={42} /> <!-- number -->
<Child value="{42}" /> <!-- (magically) number -->
<Child value="{42} " /> <!-- string -->
Logs
No response
System Info
REPL (Svelte Version 3.51.0)
Windows 10, 64bit
Chrome 106.0.5249.103
Severity
annoyance
TheCymaera, yhdgms1, willnationsdev, gyurielf, dominikg and 20 moredanielniccoli
Metadata
Metadata
Assignees
Labels
No labels