3 ms·
Agreed. I suspect this example would have some surprising behaviors if the component orchestrating the confirmation flow were rerendered while the confirm dial
by jameshart 6y ago
Agreed.
I suspect this example would have some surprising behaviors if the component orchestrating the confirmation flow were rerendered while the confirm dialog is being displayed. Does the state machine get reinitialized, closing the dialog? Or is the ‘confirming’ state retained, but the onConfirm callback in the context updated? Or is the ‘in flight’ state machine retained? In any case, is that represented by a state transition or is the state machine just replaced with a new one?
A state system more tightly connected to react’s own model would allow it to address those concerns more directly.