Repository navigation
xstate@4.19.0
Minor Changes
-
4f2f626d#2143 Thanks @davidkpiano! - Tags can now be added to state node configs under the.tagsproperty:const machine = createMachine({ initial: 'green', states: { green: { tags: 'go' // single tag }, yellow: { tags: 'go' }, red: { tags: ['stop', 'other'] // multiple tags } } });You can query whether a state has a tag via
state.hasTag(tag):const canGo = state.hasTag('go'); // => `true` if in 'green' or 'yellow' state