Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

structuralSharing should be false by default #1708

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

Closed
fermmm opened this issue Jan 28, 2021 · 1 comment
Closed

structuralSharing should be false by default #1708

fermmm opened this issue Jan 28, 2021 · 1 comment

Comments

@fermmm
Copy link

fermmm commented Jan 28, 2021

The issues received by the users when structuralSharing did not exist are this kind of issues "I want this feature", example:
#430

The issues received by the users when structuralSharing was implemented and set to true by default are this kind of issues: "I have a bug and I don't know what is happening", examples:
#1633
#1657 (comment)

"I want this feature" vs "I have a bug"... I think it's easy to decide, having a bug consumes a lot of time. Features that are enabled by default should be the ones that does not generate hard to debug issues or "gotchas". Also the warning for this is well hidden on the documentation, which is not friendly.

@tannerlinsley
Copy link
Collaborator

We're always open to improving the documentation, but for now the plan is to stick with the default structuralSharing. The side-effects of turning this off could be much worse than most anticipate. The expectation for data structures to remain constant from render to render is a very very common one in the React ecosystem, which was the first motivator for this feature, among many others. Removing this default would effectively start mal-triggering every single useEffect or === change detection mechanism in every single app that uses React Query.

Converting this to a discussion so we can continue to keep tabs and discuss it.

@TanStack TanStack locked and limited conversation to collaborators Jan 29, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants