-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to React 19 #2172
Draft
aryaemami59
wants to merge
25
commits into
reduxjs:master
Choose a base branch
from
aryaemami59:migrate-to-react-19
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Migrate to React 19 #2172
+1,266
−1,531
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
aryaemami59
force-pushed
the
migrate-to-react-19
branch
2 times, most recently
from
May 16, 2024 15:03
b7877bc
to
93b6f07
Compare
✅ Deploy Preview for react-redux-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
aryaemami59
force-pushed
the
migrate-to-react-19
branch
from
August 10, 2024 12:41
923eff2
to
53261de
Compare
aryaemami59
force-pushed
the
migrate-to-react-19
branch
6 times, most recently
from
September 13, 2024 22:32
1ed9e74
to
ac01df2
Compare
aryaemami59
force-pushed
the
migrate-to-react-19
branch
4 times, most recently
from
October 8, 2024 22:20
67a048a
to
258edeb
Compare
aryaemami59
force-pushed
the
migrate-to-react-19
branch
14 times, most recently
from
October 18, 2024 06:43
f219d06
to
5d32aee
Compare
aryaemami59
force-pushed
the
migrate-to-react-19
branch
2 times, most recently
from
October 26, 2024 12:32
f8b54ef
to
465a225
Compare
aryaemami59
force-pushed
the
migrate-to-react-19
branch
from
November 6, 2024 15:25
465a225
to
c4b88a6
Compare
- We set the `@types/react` and `@types/react-dom` package resolutions to `npm:types-react` and `npm:types-react-dom` according to the React 19 migration guide.
- `ReactDOM.render` and `ReactDOM.unmountComponentAtNode` have been removed in React 19. This commit replaces their usage with `rtl.render` and `rtl.cleanup` as recommended in the React 19 migration guide.
- The `renderHook` method in `@testing-library/react-hooks` has now been moved to `@testing-library/react`. This commit updates imports and usages of the `renderHook` function to comply with the new syntax requirements in the [react-hooks-testing-library migration guide](https://github.com/testing-library/react-hooks-testing-library/blob/chore/migration-guide/MIGRATION_GUIDE.md#waitfornextupdate).
- `react-is` has changed the `REACT_ELEMENT_TYPE` symbol from `'react.element'` to `'react.transitional.element'`. We want our changes to be non-breaking and backwards-compatible so we conditionally set the `REACT_ELEMENT_TYPE` based on the detected version of React.
- According to `@testing-library/react` docs, the `cleanup` function is called automatically during the `afterEach` hook and there is no need to manually call it.
aryaemami59
force-pushed
the
migrate-to-react-19
branch
from
November 11, 2024 23:38
c4b88a6
to
5e0653c
Compare
aryaemami59
force-pushed
the
migrate-to-react-19
branch
from
November 13, 2024 19:48
5e0653c
to
5f46b99
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR:
Updates
react
andreact-dom
to v19 beta.Sets the
@types/react
and@types/react-dom
package resolutions tonpm:types-react
andnpm:types-react-dom
according to the React 19 migration guide.Runs tests against different versions of React during CI. Not sure if we want to keep this addition but for now it serves as a way for us to make sure the changes we make are non-breaking and can work with both React 18 and 19.
Removes the now deprecated
react-test-renderer
package as recommended in the React 19 migration guide.Updates
@testing-library/react
to latest version.Updates
@testing-library/jest-dom
to latest version.Replaces the now removed
ReactDOM.render
calls with therender
function from@testing-library/react
as recommended in the React 19 migration guide.Replaces the now removed
ReactDOM.unmountComponentAtNode
calls with thecleanup
function from@testing-library/react
as recommended in the React 19 migration guide.Updates the import path of the
renderHook
function from@testing-library/react-hooks
to@testing-library/react
as recommended by A Note about React 18 Support and react-hooks-testing-library React 18 Migration guide.Removes the now unneeded
@testing-library/react-hooks
package.Updates the new
renderHook
calls according to react-hooks-testing-library React 18 Migration guide.Updates the inlined
react-is
implementation.Click to expand
react-is
related detailsIn PR#28813
react-is
changed theREACT_ELEMENT_TYPE
symbol from'react.element'
to'react.transitional.element'
. We want our changes to be non-breaking and backwards-compatible so we conditionally set theREACT_ELEMENT_TYPE
based on the detected version of React. While this is not ideal, thereact-is
package isCJS
and not very tree-shakable. So for now we want to inline it as to not add unnecessary weight to bundle sizes, not to mention the conditional React version check helps keep our changes backwards-compatible.Removes unnecessary
rtl.cleanup
function calls insideafterEach
hooks as per@testing-library/react
docs, it is done automatically.Expands version ranges of
react
and@types/react
inpeerDependencies
to include version 19.