πŸ‘¨β€πŸ’Ό Great job! You now know what to do to properly handle the initialization (and reset) of your state.
πŸ¦‰ Keep in mind that the key prop can also be used as a way to reset the state of a component, and it works pretty well. However it does require that everything is unmounted and remounted, which may not be what you want depending on the situation.
Loading State Initializer Elaboration form