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

fix(datagrid): use same empty array every time #5999

Conversation

wkeese
Copy link
Contributor

@wkeese wkeese commented Sep 4, 2024

Closes #5998

Since [] !== [], need to be careful when setting [] as a default value and then using it in the dependencies of useEffect() etc.

What did you change?

Created constant variables so that filters, reactTableFiltersState, etc. variables get the same default value every time.

How did you test and verify your work?

Storybook

Since [] !== [], need to be careful when setting [] as a
default value and then using it in the dependencies of
useEffect() etc.

Fixes carbon-design-system#5998.
@wkeese wkeese requested a review from a team as a code owner September 4, 2024 05:33
@wkeese wkeese requested review from matthewgallo and devadula-nandan and removed request for a team September 4, 2024 05:33
Copy link

netlify bot commented Sep 4, 2024

Deploy Preview for carbon-for-ibm-products ready!

Name Link
🔨 Latest commit b555c31
🔍 Latest deploy log https://app.netlify.com/sites/carbon-for-ibm-products/deploys/66d7f12cd7dc8100088aaecb
😎 Deploy Preview https://deploy-preview-5999--carbon-for-ibm-products.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@devadula-nandan devadula-nandan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@matthewgallo matthewgallo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing this @wkeese! We just saw something similar in a different component that was moving from defaultProps to default function params.

@matthewgallo matthewgallo added this pull request to the merge queue Sep 4, 2024
Merged via the queue into carbon-design-system:main with commit e6ce08b Sep 4, 2024
22 of 23 checks passed
@wkeese wkeese deleted the fix/filterpanel-infinite-redraws branch September 4, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Datagrid: FilterPanel endless redraws: fix empty array issues
3 participants