Skip to content

How to type guards so that their event & { cond } arguments contain the correct props? #2116

Answered by Andarist
lsps9150414 asked this question in Q&A
Discussion options

You must be logged in to vote

For now, you need to assert the type in your guard's implementation. We are thinking about how to make this better with an additional tool that would aid the development. The current attempts at this can be found here: https://github.com/mattpocock/xstate-codegen but this doesn't cover your use case yet.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lsps9150414
Comment options

Answer selected by lsps9150414
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants