-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$props
aliasing allows invalid names
#12626
Comments
Related #5903 |
It allows something like this. Maybe a naming convention which makes sense (not this obviously) is using this "feature" somewhere. I think <Component "=;123"={"foo"} /> should work though if this is going to be allowed. |
But you can easily pass a prop with any name using spreading: let props = { "=;123": 42 };
<Component {...props} /> |
It will break the "compatibility" with HTML, and no one uses such names because they only cause headaches in other places. Those who do need it can still use prop spreading, prop aliasing, rest props, etc. |
I think it's fine to allow some special characters here, but definitely not |
The HTML standard disallows space, |
In addition, given that spreading works with anything, I don't think anything should be done here. |
Describe the bug
This is syntactically valid:
but obviously, this is not:
Svelte should throw an error on invalid prop names here.
Reproduction
REPL
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: