DEV Community

Discussion on: "Just Use Props": An opinionated guide to React and XState

Collapse
skona27 profile image
Jakub Skoneczny

I just really like the part where you make an abstraction and don't pass send directly:

<ChildComponent
    isOpen={state.matches('open')}
    toggle={() => send('TOGGLE')}
/>
Enter fullscreen mode Exit fullscreen mode

It is so much easier to make any future refactors because your child components don't know anything about the XState - they get values to render and functions to run as event handlers.

Good work, and keep spreading the XState knowledge! IMO it will become the most popular library for any state management soon 🙂