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

[Datatable] - React: breaking change made to lifecycle #6813

Closed
Deriohig opened this issue Sep 10, 2020 · 4 comments
Closed

[Datatable] - React: breaking change made to lifecycle #6813

Deriohig opened this issue Sep 10, 2020 · 4 comments
Labels
component: data-table role: dev 🤖 severity: 3 https://ibm.biz/carbon-severity type: bug 🐛 version: 10 Issues pertaining to Carbon v10

Comments

@Deriohig
Copy link

Deriohig commented Sep 10, 2020

[Datatable] - React: breaking change made to lifecycle

What package(s) are you using?

  • [ x] carbon-components
  • [ x] 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).

Is this issue related to a specific component?

Data table

What did you expect to happen? What happened instead? What would you like to
see changed?

Use a pre-render lifecycle method

What browser are you working in?

What version of the Carbon Design System are you using?
"carbon-components": "10.15.0",
"carbon-components-react": "7.15.0",

What offering/product do you work on? Any pressing ship or release dates we
should be aware of?

IBM Security Guardium Insights (November 1st)

Steps to reproduce the issue

contact me on slack for demo

Additional information

  • Screenshots or code
  • Notes
@joshblack
Copy link
Contributor

joshblack commented Sep 11, 2020

Hi there @Deriohig! 👋

Sorry to hear about the breaking changes, could you provide some steps to reproduce the issue in a codesandbox?

@avainch
Copy link

avainch commented Sep 14, 2020

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.

@sstrubberg
Copy link
Member

Where are ya'll at with this issue? Is it still happening for you?

@tay1orjones tay1orjones added the version: 10 Issues pertaining to Carbon v10 label Sep 30, 2024
@carbon-bot
Copy link
Contributor

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! 💙

@carbon-bot carbon-bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2024
@github-project-automation github-project-automation bot moved this from ⏱ Backlog to ✅ Done in Design System Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data-table role: dev 🤖 severity: 3 https://ibm.biz/carbon-severity type: bug 🐛 version: 10 Issues pertaining to Carbon v10
Projects
Archived in project
Development

No branches or pull requests

7 participants