The result of prev key will not trigger rerender #2190
Unanswered
IridescentMia
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
// 👇🏻 from 1.3.0
// We can only set state if it's safe (still mounted with the same key).
if (isCurrentKeyMounted()) {
setState(newState);
}
If a component trigger two request with different key in a short time, the result of prev key will not trigger rerender because isCurrentKeyMounted is false
What if I need the prev result. for example, in searching scene, query as key, I want to show the result of prev query even if it is no longer mounted.
Beta Was this translation helpful? Give feedback.
All reactions