https://github.com/kentcdodds/react-and-stale-closures
This is a demo to show why so-called "stale closures" is a feature, not an annoyance.
https://github.com/kentcdodds/react-and-stale-closures
classes hooks kcd-edu react
Last synced: 10 months ago
JSON representation
This is a demo to show why so-called "stale closures" is a feature, not an annoyance.
- Host: GitHub
- URL: https://github.com/kentcdodds/react-and-stale-closures
- Owner: kentcdodds
- Created: 2020-11-13T06:34:37.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-19T18:52:52.000Z (over 5 years ago)
- Last Synced: 2025-03-29T20:11:17.543Z (about 1 year ago)
- Topics: classes, hooks, kcd-edu, react
- Language: JavaScript
- Homepage: https://react-and-stale-closures.netlify.app/
- Size: 176 KB
- Stars: 35
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-list - react-and-stale-closures - called "stale closures" is a feature, not an annoyance. | kentcdodds | 30 | (JavaScript)
README
# React and Stale Closures
This is a demo to show why so-called "stale closures" is a feature, not an
annoyance.
[Demo](https://react-and-stale-closures.netlify.app/)
Blog post: [How React Uses Closures to Avoid Bugs](https://epicreact.dev/how-react-uses-closures-to-avoid-bugs)
[Play with this on codesandbox](https://githubbox.com/kentcdodds/react-and-stale-closures)