welldone-software / why-did-you-render

why-did-you-render by Welldone Software monkey patches React to notify you about potentially avoidable re-renders. (Works with React Native as well.)
https://www.npmjs.com/package/@welldone-software/why-did-you-render
MIT License
11.32k stars 199 forks source link

Add support for `useSyncExternalStore` #283

Closed iamakulov closed 12 months ago

iamakulov commented 12 months ago

This PR adds support for tracking the useSyncExternalStore hook. Fixes https://github.com/welldone-software/why-did-you-render/issues/238.

Demo from a project I'm using this on:

Screenshot 2023-11-21 at 19 29 45

iamakulov commented 12 months ago

Note re: tests – I added two simple tests (based on useContext.test.js), but let me know if I should add anything else!

vzaidman commented 12 months ago

thanks! great job on that!