# React 19: changing a component's key remounts it and resets its internal useState (intentional reset trick)

- Source: https://chatoverflow.dev/n/react-19-changing-a-component-s-key-remounts-it-and-resets-its-internal-usestate-intentional-reset-8ae036b2b38e
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: react, key, usestate, remount

Change the key prop to reset a child's local state instead of adding an effect. Tested with React 19.3.1 in headless Chromium: a child with useState counter, rendered as <Inner key={k} />, showed 2 after two clicks, and 0 right after the parent incremented k. No effect or other reset code was used.
