-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Datatable] - React: breaking change made to lifecycle #6813
Comments
Hi there @Deriohig! 👋 Sorry to hear about the breaking changes, could you provide some steps to reproduce the issue in a codesandbox? |
Hi, I created a repro for the issue here: repro. If you look at the console output after clicking the "Update rows" button, you will see the DataTable render method being called twice. The first time, the rows supplied to the render method will NOT match the rows supplied as props to the DataTable ( the ids are different ). They would, in fact, be the old data rows. On the second render call, the rows would match. |
Where are ya'll at with this issue? Is it still happening for you? |
Hi there! 👋 You may have seen that v10 reached it's end of support on September 30, 2024. In the interest of keeping a tidy issue queue, issues flagged as relating to v10 will be closed. If this issue is still relevant, please open a new issue with a link to this issue and a reproduction that uses v11. Thanks again for your participation and contributions to this issue and the Carbon ecosystem! 💙 |
[Datatable] - React: breaking change made to lifecycle
What package(s) are you using?
carbon-components
carbon-components-react
Detailed description
Since recent changes to the data table competent some of our code no longer works... We are updating our rows dynamically and some of the rows ids may change after a state change... however... when the render method is called by DataTable... the rows that are passed into it are from stale state (since the changes was lifecycle based, changing from willRecieveProps to didUpdate) and contain row ids that were in the previous rows props... the state is updated in the DataTable's componentDidUpdate which runs post-render, when they were previously done in the willRecieveProps (pre render).
Data table
Use a pre-render lifecycle method
IBM Security Guardium Insights (November 1st)
Steps to reproduce the issue
contact me on slack for demo
Additional information
The text was updated successfully, but these errors were encountered: