pietschy's comments

pietschy | 5 years ago | on: Using State Machines with React to Make a Confirmation Dialog (2020)

React examples like this always strike me as a great reason to avoid react, but then I'm an old OO dinosaur I suspect.

In our framework (that has angular underneath) we go..

   interactionContext.startActivity(MyConfirmDialog).then(result => ...);
...and the interactionContext handles back button clicks and makes sure the dialog is cancelled and our history is kept clean.

It even works with nested interactions (i.e. the dialog can start a new interaction in place). Again, the user can click the back button repeatedly to back out of the interaction and everything just works.

I've got no idea how you'd do that in React.

edit - fixed typos

page 1