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.2k stars 201 forks source link

Add support for `useSyncExternalStore` #283

Closed iamakulov closed 11 months ago

iamakulov commented 11 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 11 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 11 months ago

thanks! great job on that!