-
Notifications
You must be signed in to change notification settings - Fork 290
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
ReorderCell not working in React 19 due to ReactDOM.render no longer existing #743
Comments
Thanks for filing. This turned out be trickier than I imagined 😔 . fixed-data-table-2/package.json Lines 10 to 13 in 84e2d3f
To retain backward compatibility, I wanted to do feature detection by checking if This means I can't do something like: import ReactDOM from 'react-dom' // for react v17
// the next line throws an error for clients using react v17
import ReactDOMClient from 'react-dom/client' // for react v19
// ...
function renderDragProxy() {
// ...
// switch APIs based on what's available
if (ReactDOMClient?.createRoot) {
ReactDOMClient.createRoot(...).render(...)
} else {
ReactDOMClient.render(...)
}
} The path forward that I see is to make a new major version for FDT (v3.x) that drops support for React v17 in favor of React v18/v19. cc: @juzerzarif @mycrobe @novakps @tchoiSchrodinger @miskreant |
I think unfortunately that you are correct. While awaiting feedback, would you mind creating a beta of a next major version to unblock us upgrading to React 19? Thanks! |
Sure. Let me see if I can put a quick FDT v3-experimental release with React bumped up to test out stuff. Btw, clients can also pass their own implementation for reordering cells. The simplest approach (just for unblocking purposes) would be to copy it's code, replace |
@jimmycallin , please try out v3.0.1-react-v19 and let me know how it works out. Reordering worked out when I smoke tested locally. |
just tried it out and so far so good - thank you! 🙏 |
Expected Behavior
fixed-data-table-2 reordering feature should work in React 19
Current Behavior
When upgrading to React 19, you get an error when trying to reorder a cell that ReactDom.render is not a function.
Possible Solution
See here:
fixed-data-table-2/src/plugins/ResizeReorder/ReorderCell.js
Line 243 in 84e2d3f
Replace ReactDOM.render with ReactDOM.createRoot for newer React versions.
Steps to Reproduce (for bugs)
Your Environment
The text was updated successfully, but these errors were encountered: