material-table-core / core

Datatable for React based on material-ui's table with additional features. Support us at https://opencollective.com/material-table-core
https://material-table-core.github.io
MIT License
296 stars 146 forks source link

Support React v18 #536

Closed MLNW closed 1 year ago

MLNW commented 2 years ago

Is your feature request related to a problem? Please describe.

I want to use this package with React v18. When I upgrade my dependencies accordingly, pnpm shows the following peerDependency issues:

├─┬ @material-table/core
│ ├─┬ react-beautiful-dnd
│ │ ├── ✕ unmet peer react@"^16.8.5 || ^17.0.0": found 18.0.0
│ │ ├── ✕ unmet peer react-dom@"^16.8.5 || ^17.0.0": found 18.0.0
│ │ ├─┬ react-redux
│ │ │ └── ✕ unmet peer react@"^16.8.3 || ^17": found 18.0.0
│ │ └─┬ use-memo-one
│ │   └── ✕ unmet peer react@"^16.8.0 || ^17.0.0": found 18.0.0
│ └─┬ @mui/lab
│   └─┬ @mui/x-date-pickers
│     └── ✕ unmet peer react@^17.0.2: found 18.0.0

Describe the solution you'd like This package should natively support React v18.

Describe alternatives you've considered Do not upgrade React until its new version is supported.

Additional context

Relevant package versions:

"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@material-table/core": "^0.2.32",
"@mui/icons-material": "^5.6.2",
"@mui/lab": "^5.0.0-alpha.78",
"@mui/material": "^5.6.2",
"react": "^18.0",
"react-dom": "^18.0",
Domino987 commented 2 years ago

Hi, yes we want to support all versions of react in the future, but as the pnmp print already mentions, we have to wait for the other libs to support it. And since is not the case yet, we have to wait as well. But ill keep this open to support it ASAP

MLNW commented 2 years ago

Regarding the @mui/x-date-pickers: It seems like the date pickers were moved out of the lab with Release v5.6.0. Relevant MR: https://github.com/mui/material-ui/pull/31984

Here is the migration guide: https://mui.com/x/react-date-pickers/migration-lab/

MLNW commented 2 years ago

Regarding react-beautiful-dnd: It seems like the package is no longer maintained as seen in the README and this issue regarding React v18 migration https://github.com/atlassian/react-beautiful-dnd/issues/2388. Maybe we need to move on to https://github.com/react-forked/dnd?

MLNW commented 2 years ago

Regarding react-redux: The major release v8 about a week ago has introduced React v18 support, see https://github.com/reduxjs/react-redux/releases/tag/v8.0.0.

Domino987 commented 2 years ago

Regarding react-redux: The major release v8 about a week ago has introduced React v18 support, see https://github.com/reduxjs/react-redux/releases/tag/v8.0.0.

This is only connected to dnd so we do not need to update it manually.

Domino987 commented 2 years ago

Regarding the @mui/x-date-pickers: It seems like the date pickers were moved out of the lab with Release v5.6.0. Relevant MR: mui/material-ui#31984

Here is the migration guide: https://mui.com/x/react-date-pickers/migration-lab/

This is done locally.

Domino987 commented 2 years ago

Regarding react-beautiful-dnd: It seems like the package is no longer maintained as seen in the README and this issue regarding React v18 migration atlassian/react-beautiful-dnd#2388. Maybe we need to move on to https://github.com/react-forked/dnd?

I agree, but they do not support 18 yet either.

MLNW commented 2 years ago

Regarding react-beautiful-dnd: It seems like the package is no longer maintained as seen in the README and this issue regarding React v18 migration atlassian/react-beautiful-dnd#2388. Maybe we need to move on to https://github.com/react-forked/dnd?

I agree, but they do not support 18 yet either.

Yes that is correct, here is the relevant MR: https://github.com/react-forked/dnd/issues/293

sairam0903 commented 2 years ago

Any news or updates on when this is supported for React 18?

Domino987 commented 2 years ago

The redux fork is not yet updated

imnasnainaec commented 2 years ago

Regarding react-beautiful-dnd: It seems like the package is no longer maintained as seen in the README and this issue regarding React v18 migration atlassian/react-beautiful-dnd#2388. Maybe we need to move on to https://github.com/react-forked/dnd?

I agree, but they do not support 18 yet either.

Yes that is correct, here is the relevant MR: react-forked/dnd#293

Here's the hold-up as of April: https://github.com/react-forked/dnd/pull/336

mahmoudim commented 2 years ago

I know it doesn't have the same behavior but might be a good idea to migrate to react-dnd

Xhale1 commented 2 years ago

@imnasnainaec @MLNW I created a new fork of react-beautiful-dnd which supports React 18 and react strict mode, @hello-pangea/dnd

It should be a drop-in replacement. Just replace every mention of react-beautiful-dnd with @hello-pangea/dnd

Domino987 commented 2 years ago

I'll try that this week. That's great thank you. I might come back to you if you want to help make the table v18 ready too 😅 or at least show some pitfalls to avoid

avenger90 commented 2 years ago

Hi @Domino987 , I am using mui v5, does material-table-core v0.2.35 supports reacts 18 or are we still waiting on dependencies to upgrade?

Domino987 commented 2 years ago

Yes, we did a great leap with the dnd update, but we are still missing out on an few.

Domino987 commented 2 years ago

Can you guys try the newest next version 0.2.40 for react 18?

avenger90 commented 2 years ago

yes, we will try with react 18 and let you know.

sucy6330133 commented 2 years ago

I have tried the latest next version 0.2.42, the deepmerge-ts issue is still there. Seems more like a webpack issue. Any plan to fix it?

Domino987 commented 2 years ago

The deep merge work for me. Did you update your npm install and everything?

sucy6330133 commented 2 years ago

Yes, I have fully updated. v0.2.37 is working, just broken after upgrade to 0.2.38. Also tried the latest one. No luck.

Domino987 commented 2 years ago

weird. Would you mind throwing your setup into a sandbox? For me to inspect

sucy6330133 commented 2 years ago

It might related to this issue https://github.com/facebook/create-react-app/pull/12605

Domino987 commented 2 years ago

Can you all try the latest version ;)

imnasnainaec commented 2 years ago

Oh yay, react-beautiful-dnd supports React v18 now: https://github.com/atlassian/react-beautiful-dnd/releases/tag/v13.1.1!

sucy6330133 commented 2 years ago

Can you all try the latest version ;)

Works fine to me now. Tried version v0.2.48.

sairam0903 commented 1 year ago

Hi @Domino987 can you help with this issue https://github.com/material-table-core/core/issues/660