-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Action parameter type error #754
Comments
I am not able to reproduce this. |
I can reproduce it. My guess is that the type parameter of the We might need to find another way to transform the action in svelte2tsx. |
The "no |
sveltejs#754 Avoid incorrect type inference in edge cases by calling the functions directly. Also cleaned up typings - actions/animations/transitions only have one parameter, not arbitrary ones. Therefore passing a ( and ) around the params so they are interpreted as a comma-separated command instead of two parameters if user does use:action={1,2} , because it is interpreted as action(node, (1,2)) by the Svelte compiler.
#754 Avoid incorrect type inference in edge cases by calling the functions directly. Also cleaned up typings - actions/animations/transitions only have one parameter, not arbitrary ones. Therefore passing a ( and ) around the params so they are interpreted as a comma-separated command instead of two parameters if user does use:action={1,2} , because it is interpreted as action(node, (1,2)) by the Svelte compiler.
use:action
throwsType 'string' is not assignable to type '"left" | "right"'. ts(2345)
Expected no error, as calling the action in the script block does not throw
{ border: 'right' as const }
throwsUnexpected token ts(-1)
The text was updated successfully, but these errors were encountered: