next.js
c40eb0c1 - [bundle-analyzer] Disable revalidateOnFocus and revalidateOnReconnect (#86688)

Commit
140 days ago
[bundle-analyzer] Disable revalidateOnFocus and revalidateOnReconnect (#86688) For the `experimental-analyze`, the page resets its selected state `onSuccess`. https://github.com/vercel/next.js/blob/2307d46f511d02f48d4b8f93713c4bc087c0e5ff/apps/bundle-analyzer/app/page.tsx#L64-L68 However, since SWR revalidates on focus, if you click outside the tab and come back, e.g., write to docs or messengers, it revalidates and resets the state. Since the current view can be inside multiple depths, losing that state for focus can be painful. Therefore, set `revalidateOnFocus` to false. For similar reasons, set `revalidateOnReconnect` to false as well. ### Before https://github.com/user-attachments/assets/ed04b4c2-f414-4fd9-9a6e-4c910031af9f ### After https://github.com/user-attachments/assets/4130e3ca-9f3a-4f8b-8a5b-a8eb8d7d23dc
Author
Parents
Loading