-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Bug: Enqueued Actions throw type error inside setup() #4545
Comments
Unfortunately, we are hitting a limitation in TypeScript right now. I'd be happy to review any PR that fixes this but I already tried extensively to fix this issue with no luck. I will be working towards fixing this within the TS compiler but that will take some time to do, get reviewed, and released. For the time being, we need to classify this as a limitation that we are aware of and add a note about this in the docs or something. |
To expand on the (temporary?) workaround, use
Another possible option is to use the |
#4750 fixes the reported issue. It's still not perfect but the OP's code works alright with this PR |
The issue still persists in |
The original example does work with the latest versions. Can you please open a new issue with code that shows that it is not working? |
Done #4923 👍🏽 |
Description
When using the new setup api to provide actions when you use the enqueueActions action typescript throws
Expected result
This should not throw an error. It does not throw an error when it is used as an object passed to createMachine
Actual result
Reproduction
https://codesandbox.io/p/sandbox/silly-danny-vf63fc
Additional context
Also just incase demo doesn't show it when you goto the repro it was being weird when I would refresh and it would show the right type but when I commented it out it would break again 🤔
Area.mp4
The text was updated successfully, but these errors were encountered: