-
Notifications
You must be signed in to change notification settings - Fork 21
Upgrade React from 17 to 18 #501
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d774138
Route react imports through a routerCompat module (part 1 of 3)
blaipr 6c4ef9b
Route remaining react imports through routerCompat (part 2 of 3)
blaipr ef1e8f1
Flip react-router-dom to v6, remove the compat shim (part 3 of 3)
blaipr b75e482
Merge remote-tracking branch 'origin/main' into feature/router-compat-3
blaipr acf774f
Merge remote-tracking branch 'origin/main' into feature/router-compat-3
blaipr 5c66d44
Merge remote-tracking branch 'origin/main' into feature/router-compat-3
blaipr ebb3790
Upgrade React from 17 to 18
blaipr d90d602
Fix no-nested-ternary lint error in setupTests.js
blaipr c0af29f
Address review feedback on React 18 upgrade
blaipr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,24 @@ | ||
| import React from 'react'; | ||
| import ReactDOM from 'react-dom'; | ||
| import App from './App'; | ||
|
|
||
| jest.mock('react-dom', () => ({ render: jest.fn() })); | ||
| const mockRender = jest.fn(); | ||
| jest.mock('react-dom/client', () => ({ | ||
| createRoot: jest.fn(() => ({ render: mockRender })), | ||
| })); | ||
| jest.mock('util/webWorker', () => jest.fn()); | ||
|
|
||
| describe('index.jsx', () => { | ||
| it('renders ok', () => { | ||
| const { createRoot } = require('react-dom/client'); | ||
| const div = document.createElement('div'); | ||
| div.setAttribute('id', 'app'); | ||
| document.body.appendChild(div); | ||
| require('./index.js'); // eslint-disable-line global-require | ||
| expect(ReactDOM.render).toHaveBeenCalledWith( | ||
| expect(createRoot).toHaveBeenCalledWith(div); | ||
| expect(mockRender).toHaveBeenCalledWith( | ||
| <React.StrictMode> | ||
| <App /> | ||
| </React.StrictMode>, | ||
| div | ||
| </React.StrictMode> | ||
| ); | ||
| }); | ||
| }); |
This file contains hidden or 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 file contains hidden or 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
3 changes: 1 addition & 2 deletions
3
awx/ui/src/screens/Organization/OrganizationAdd/OrganizationAdd.test.js
This file contains hidden or 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
3 changes: 1 addition & 2 deletions
3
awx/ui/src/screens/Organization/OrganizationEdit/OrganizationEdit.test.js
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
2 changes: 1 addition & 1 deletion
2
awx/ui/src/screens/WorkflowApproval/WorkflowApprovalList/useWsWorkflowApprovals.test.js
This file contains hidden or 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 file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.