React 18 Upgrade
See original GitHub issueFeature Description
React 18 is now available as a release candidate
The biggest changes relevant for us that I see so far:
- Replacing
ReactDOM.render()
withcreateRoot()
- Automatic batching
We can probably remove
useBatchingCallback
frompackages/react
useId()
-> new hook for generating unique IDs on both the client and server We obviously don’t use SSR, but maybe we can replaceuuidv4
in some places with that.globalThis.IS_REACT_ACT_ENVIRONMENT
Probably no change needed besides updating Testing Library- No more “setState on unmounted component” warnings
We added some workarounds in the past to prevent this warnings (e.g.
let mounted
orisMounted = useRef()
). Should be able to remove these now.
Some other noteworthy APIs:
useSyncExternalStore
startTransition
useDeferredValue
Alternatives Considered
Additional Context
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to Upgrade to React 18
In this post, we will guide you through the steps for upgrading to React 18. Please report any issues you encounter while upgrading...
Read more >React 18 Upgrade Guide and New Features - Refine Dev
React 18 was released! Are you looking to upgrade to React 18? Learn about the new features and changes in this comprehensive guide....
Read more >How to Upgrade to React 18 - How-To Geek
React 18 is stable and ready to use. In most cases the upgrade process should be quick and easy, requiring only an npm...
Read more >Upgrading to React 18 - Daily Dev Tips
This will upgrade your react and react-dom versions to at least 18. ... Now that we upgraded React itself to version 18 let's...
Read more >An Ultimate Guide to Upgrading to React 18 - OpenReplay Blog
The React team recently released React 18 with improvements like automatic batching, a new suspense feature, and new APIs like startTransition .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
All PRs have been merged, now we just have to wait for new releases 😃
Something that might need some testing is the “double useEffect” call when in dev mode / strict mode.
https://www.youtube.com/watch?v=j8s01ThR7bQ
Will probably result in some double fetch calls etc… not sure what else.