-
Notifications
You must be signed in to change notification settings - Fork 47
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
DX for typed events #65
Comments
I understand that TypeScript is showing one example of a correct possible value - but since you apparently can bend TypeScript to your will 🤪, can anything be done here? |
HAHAHAHA this is 100% going to twitter xD Could you send that code? I can't repro minimally. EDIT: oh wait you said it's from examples, looking into it |
This is most probably a bug, so i'll report it to typescript team, meanwhile let me see if I can find a workaround |
Stands true ;) |
I'll publish the beta after we merge this then. |
as a workaround for typescript bug
For reference and reminder to revert overloads when #45217 gets fixed. |
Hey @devanshj, when using types events, I'm getting a confusing error message. Here's a sample case:
1 - I have a types "UPDATE" event that requires a string value
2 - When trying
send({ type: "UPDATE" })
it gives me an error (right, it is missing thevalue
)3 - Problem is, the error says
Type '"UPDATE"' is not assignable to type '"some other type"'
:Here is an example (the
examples/form
with this added send on line 57:The text was updated successfully, but these errors were encountered: