https://github.com/andrekovac/react-18-gotchas
Collection of things I had to get used to after upgrading from React v17 to React v18
https://github.com/andrekovac/react-18-gotchas
Last synced: 5 months ago
JSON representation
Collection of things I had to get used to after upgrading from React v17 to React v18
- Host: GitHub
- URL: https://github.com/andrekovac/react-18-gotchas
- Owner: andrekovac
- License: gpl-3.0
- Created: 2022-07-15T12:21:19.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-28T12:43:29.000Z (over 3 years ago)
- Last Synced: 2025-06-14T19:09:51.107Z (about 1 year ago)
- Size: 15.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ⚛️🤓 React 18 gotchas
Collection of things I had to get used to after upgrading from React v17 to React v18
## React 18 features / differences
### [`React.StrictMode`](https://reactjs.org/docs/strict-mode.html)
`StrictMode` in React 18 [adds a second rendering immediately after initial mount](https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-strict-mode).
When using the `useEffect` hook, you should always [add a cleanup if needed](https://beta.reactjs.org/learn/synchronizing-with-effects#step-3-add-cleanup-if-needed).
[Here](https://github.com/facebook/react/issues/24502#issuecomment-1118867879)'s what Dan Abramov has to say about it.
However, sometimes this can be a bit trickier...
*TBC*
### `useSyncExternalStore` hook
*TBC*
### `Suspense` and `startTransition`
- [What is tearing?](https://github.com/reactwg/react-18/discussions/69)
## About
This is a living document and will be continously expanded as I learn more about React 18 🤓.