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

Update in reactive vars do NOT cause expected re-renders in 3.3.7 (regression) #7609

Closed
delyanr opened this issue Jan 23, 2021 · 1 comment · Fixed by #7652
Closed

Update in reactive vars do NOT cause expected re-renders in 3.3.7 (regression) #7609

delyanr opened this issue Jan 23, 2021 · 1 comment · Fixed by #7652

Comments

@delyanr
Copy link

delyanr commented Jan 23, 2021

Intended outcome:
Updates to reactive vars in one component should trigger re-renders across all other components that are listening to the said reactive vars. I've tested this using useReactiveVar - not sure if the issue also occurs when using useQuery with the @client directive.

Actual outcome:
Other components are not being re-rendered, and thus are using stale data.

How to reproduce the issue:
This could be related to #7593, although the issue described here occurs only in the latest v3.3.7. (So it's a regression!)

Please use the following link for reproduction: codesandbox

Refresh the page and see that the two components show different data for the reactive variable. One of the components triggers an update to the reactive var via useEffect, which in turn does not cause a re-render to the other component.

Change the apollo-client version back to 3.3.6, and see that this no longer happens.

Versions
React: v16.14.0 - v17.0.1
Apollo-client: v3.3.7

@benjamn
Copy link
Member

benjamn commented Feb 5, 2021

@delyanr Thanks to your reproduction, I can confirm that this is fixed in @apollo/client@3.3.8 (just published).

@brainkim brainkim assigned brainkim and unassigned brainkim Jun 22, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants