Bug: invoke id callback not typed as a function
XState version
XState version 5
Description
The id can be used as a callback but I am getting typescript errors. Wondering its a bug in the typing or is this a bug in that it shouldnt take a callback?
Expected result
i expect only a string to work because thats what the typing is.
Actual result
A callback is what i need but the ts support isnt correct and shows an error.
Reproduction
https://codesandbox.io/p/devbox/dreamy-hill-ht77kt?file=%2Fsrc%2FfeedbackMachine.ts%3A44%2C9
Additional context
No response
v4 didn't allow dynamic IDs on invoke but I don't see a reason why we shouldn't allow this in v5. spawnChild already supports this and both use the same implementation under the hood.
Awesome, thank you. Dynamic id's are just what I needed!
This turned out to be slightly more complicated than I anticipated since we were relying on those particular IDs to be static. This bit of the implementation is funky - so perhaps this will force us to rethink what we are doing there in terms of how we allow for entry sendTo actions targeting invoked actors to be "retried".