Loading "Dad Joke Break State Initializer"
Run locally for transcripts
👨💼 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.