[FEATURE] add Hook for easier statechart matching
grandevel opened this issue · comments
Dan Clark commented
New feature request in overmind statecharts:
React-states provides a match function to match a given state. Rather than implement something custom everytime to match states in a chart, it would be useful to have a hook which can be used - something like:
const isInSomeState = useMatchState('MY_CHART', ['STATE1', 'STATE2']);
It is then much easier to control rendering or props - for example
Click me! or {isInSomeState && Click me also!}