You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
Query component caches lastResult after props are changed and never updates the stored lastResult value, meaning the component will not redraw when updated to the cached result
#2857
Closed
Glennrs opened this issue
Mar 10, 2019
· 2 comments
· Fixed by #2840
Props to query component are changed, meaning lastResult is set to value X.
Value of data query is fetching is changed to Y. Component redraws.
Value of data query is fetching is changed back to X. Component does not redraw as the shallowEquals is true to lastResult (value X), even though lastResult is value Y.
The following Gist has a repro for the issue. You can see that after the Query component has its properties updated, it will set lastResult to true and subsequently always early out when the value is set back to true again (meaning it remains in a state where it renders false).
Repro:
The following Gist has a repro for the issue. You can see that after the Query component has its properties updated, it will set lastResult to true and subsequently always early out when the value is set back to true again (meaning it remains in a state where it renders false).
https://gist.github.com/Glennrs/8051fcac26ec50a8d113cf4e4586769c
The linked to closed PR contains a fix for this issue.
Originally posted by @Glennrs in #2840 (comment)
The text was updated successfully, but these errors were encountered: