Replies: 1 comment
-
Following from: #1782 (reply in thread), and #1782 (reply in thread) Your last comment does make sense, but I wonder if you have investigated the possibility to use custom focus events. As document here. <SWRConfig
value={{
provider: () => new Map(),
initFocus(callback) {
/* Register the listener with your state provider */
},
}}
>
<App />
</SWRConfig> |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
react-navigation mounts each screen component only once (by default). This poses a major problem when using swr because it causes massive re-renders of hooks that are mounted on each (non visible) screen.
I have many hooks that are dependent on a
useSession
hook and need to update when a property of the session changes. All those hooks re-validate even when the component is not rendered (by react-navigation).I know its not only an swr problem but do any of you have an idea how to solve this issue?
Beta Was this translation helpful? Give feedback.
All reactions