Skip to content

Conversation

samay-rgb
Copy link

@samay-rgb samay-rgb commented Sep 22, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

What is the current behavior?

In commit 43afc44, the useList hook returns a new, empty array [] on every render cycle whenever queryResponse.data.data is falsy. This violates referential equality, causing hooks like useMemo and useEffect to re-calculate unnecessarily, leading to potential performance degradation.

What is the new behavior?

The useList hook now returns a stable, frozen empty array Object.freeze([]) as the default value for result.data.

fixes #7019

Notes for reviewers

@samay-rgb samay-rgb requested a review from a team as a code owner September 22, 2025 16:36
Copy link

changeset-bot bot commented Sep 22, 2025

🦋 Changeset detected

Latest commit: 04a9e40

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@refinedev/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Sep 22, 2025

Deploy Preview for refine-doc-live-previews ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 04a9e40
🔍 Latest deploy log https://app.netlify.com/projects/refine-doc-live-previews/deploys/68d90c8ca5125600087a4036
😎 Deploy Preview https://deploy-preview-7020--refine-doc-live-previews.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 project configuration.

@hongfanmeng
Copy link

The commit 43afc44 also update useTable and useMany

Copy link
Member

@alicanerdurmaz alicanerdurmaz 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 the improving Refine,

we need changeset to release this fix

@samay-rgb
Copy link
Author

Thanks for the improving Refine,

we need changeset to release this fix

Thanks for your feedback. I'll add the changeset.

@alicanerdurmaz alicanerdurmaz self-requested a review September 25, 2025 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]useList's default [] return causes useMemo to break
3 participants