0

I'm using Angular + Typescript. I would like to learn Xstate and am using a simple example. I have three components Header, Home and Summary.

Header

<h1>This is the header</h1>
<button>Previous</button>
<button>Cancel</button>

Home with '/' directory

<h1>This is the homepage</h1>

Summary with '/summary' directory

<h2>This is the summary page</h2>

I would like to hide the Previous button in my Home component but display it in my Summary component, and display the Cancel button in my Summary component but hide it in my Home component. And for that I need to know the path I am right now. How can I do that in Xstate? And then, how will I render the buttons conditionally?

I have learned how to write the states and transition from one to another, but i'm missing this part and how to put everything together. Thank you

Harvey
  • 93
  • 1
  • 7

0 Answers0