2 min read
The key prop: the cheapest state reset in React
key isn't just for lists. Change it and React throws the component away and mounts a fresh one — state included. No useEffect required.
- #fundamentals
- #state
2 min read
key isn't just for lists. Change it and React throws the component away and mounts a fresh one — state included. No useEffect required.
The Journal
Concise articles on React and Next.js, delivered to your inbox. No noise — unsubscribe in one click.