Skip to content
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

[data grid] Fix implicit dependency on react-dom #5121

Merged
merged 1 commit into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmark/browser/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import ReactDOM from 'react-dom';
import * as ReactDOM from 'react-dom';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bonus refactoring, to match the docs: https://reactjs.org/docs/react-dom.html.


// Get all the scenarios
const requirePerfScenarios = require.context('./scenarios', true, /(js|ts|tsx)$/);
Expand Down
3 changes: 2 additions & 1 deletion packages/grid/x-data-grid-premium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"peerDependencies": {
"@mui/material": "^5.4.1",
"@mui/system": "^5.4.1",
"react": "^17.0.2 || ^18.0.0"
"react": "^17.0.2 || ^18.0.0",
"react-dom": "^17.0.2 || ^18.0.0"
},
"setupFiles": [
"<rootDir>/src/setupTests.js"
Expand Down
3 changes: 2 additions & 1 deletion packages/grid/x-data-grid-pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"peerDependencies": {
"@mui/material": "^5.4.1",
"@mui/system": "^5.4.1",
"react": "^17.0.2 || ^18.0.0"
"react": "^17.0.2 || ^18.0.0",
"react-dom": "^17.0.2 || ^18.0.0"
},
"setupFiles": [
"<rootDir>/src/setupTests.js"
Expand Down
3 changes: 2 additions & 1 deletion packages/grid/x-data-grid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"peerDependencies": {
"@mui/material": "^5.4.1",
"@mui/system": "^5.4.1",
"react": "^17.0.2 || ^18.0.0"
"react": "^17.0.2 || ^18.0.0",
"react-dom": "^17.0.2 || ^18.0.0"
},
"setupFiles": [
"<rootDir>/src/setupTests.js"
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import ReactDOM from 'react-dom';
import * as ReactDOM from 'react-dom';
import { BrowserRouter as Router, Routes, Route, Link } from 'react-router-dom';
import TestViewer from './TestViewer';

Expand Down
2 changes: 1 addition & 1 deletion test/performance/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import ReactDOM from 'react-dom';
import * as ReactDOM from 'react-dom';
import { BrowserRouter as Router, Routes, Route, Link } from 'react-router-dom';
import TestViewer from './TestViewer';

Expand Down
2 changes: 1 addition & 1 deletion test/regressions/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import ReactDOM from 'react-dom';
import * as ReactDOM from 'react-dom';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m4theushw When do we plan to use React 18? It would then be

Suggested change
import * as ReactDOM from 'react-dom';
import * as ReactDOM from 'react-dom/client';

per https://reactjs.org/blog/2022/03/29/react-v18.html#new-client-and-server-rendering-apis

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm only waiting for the core repo to adopt React 18 in the infra. But nothing stops us from adopting earlier. #4155 is open.

import { BrowserRouter as Router, Routes, Route, Link } from 'react-router-dom';
import { LicenseInfo } from '@mui/x-data-grid-pro';
import TestViewer from 'test/regressions/TestViewer';
Expand Down