https://react.dev/learn/managing-state
Preserving and Resetting State
- React resets the component's state if and only if the component in the same position in the UI tree is removed or has changed to a different component.
- Note: You can override the position inside the UI tree by providing a
key
prop.
- Note: You can override the position inside the UI tree by providing a
Top comments (0)