1×
Become a member
to unlock all features
Autoplay

    Save Previous States with a History State

    reactReact
    >=16.9.0

    In order to make sure the user actually picked the answer they wanted, we’ll add a confirmation state to the state machine that gives them the option to submit their answer or go back and change it. When they go back, we need the state machine to remember all the substates that were active in the previous state. We’ll accomplish this using a history state.