Skip to content

Commit 5f1ed0b

Browse files
support for react 17
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
1 parent 9d266c4 commit 5f1ed0b

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@
105105
"@emotion/react": "^11.14.0",
106106
"@mui/icons-material": "^7.3.7",
107107
"@mui/material": "^7.3.7",
108-
"react": "^18.0.0 || ^19.0.0",
109-
"react-dom": "^18.0.0 || ^19.0.0"
108+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
109+
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
110110
},
111111
"dependencies": {
112112
"@babel/runtime-corejs3": "^7.12.1",

src/utils.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
function buildMap(rows) {
2-
return rows.reduce((accum, { dataIndex }) => {
3-
accum[dataIndex] = true;
2+
if (!rows || !Array.isArray(rows)) return {};
3+
return rows.reduce((accum, row) => {
4+
if (row != null && row.dataIndex !== undefined) {
5+
accum[row.dataIndex] = true;
6+
}
47
return accum;
58
}, {});
69
}
@@ -48,6 +51,7 @@ function getCollatorComparator() {
4851

4952
function sortCompare(order) {
5053
return (a, b) => {
54+
if (a == null || b == null) return 0;
5155
var aData = a.data === null || typeof a.data === 'undefined' ? '' : a.data;
5256
var bData = b.data === null || typeof b.data === 'undefined' ? '' : b.data;
5357
return (

0 commit comments

Comments
 (0)