Closed cassiozen closed 3 years ago
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?
you apparently can bend TypeScript to your will 🤪
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
The repro is simpler than I thought xD I was guessing it takes time to compute hence typescript was showing bad errors
And the workaround is pretty simple - to add an overload, sending a PR
you apparently can bend TypeScript to your will
Stands true ;)
sending a PR
I'll publish the beta after we merge this then.
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 saysType '"UPDATE"' is not assignable to type '"some other type"'
:Here is an example (the
examples/form
with this added send on line 57: