Open koba04 opened 2 years ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/koba04/swr-devtools/mSAcapc39bwByCihTddo1wNvEmfK
✅ Preview: https://swr-devtools-git-feat-record-swr-data-with-usedebugvalue-koba04.vercel.app
I've noticed that this approach might have extra re-render because SWR tracks the usage of the response data by getter functions. https://github.com/vercel/swr/blob/98556e12d394c819fd69535ad5fe0dd980e79fe9/src/use-swr.ts#L487-L501
This code would mark the data as used even if the actual implementation didn't access the data.
useDebugValue can be used to display values in React Developer Tools. This PR is to add
useDebugValue
in SWR DevTools middleware to display SWR data.