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.)

MIT License

Downloads
1.8M
Stars
10.8K
Committers
37

Bot releases are visible (Hide)

why-did-you-render -

Published by vzaidman over 4 years ago

fixed a minor bug where no tracking was made if the previous value of a hook was falsy

why-did-you-render - improved typescript typings

Published by vzaidman over 4 years ago

Thank you very much @OliverJAsh for pr https://github.com/welldone-software/why-did-you-render/pull/104 <3

why-did-you-render -

Published by vzaidman over 4 years ago

  • improved readme
  • updated to react 16.13.1 and tested
  • updated all libraries like babel
why-did-you-render -

Published by vzaidman over 4 years ago

  • improved readme
  • improved typescript support
  • updated all dev packages and tested the library with them
why-did-you-render - improved readme

Published by vzaidman over 4 years ago

why-did-you-render - fixed lack of tracking where display name couldn't be changed

Published by vzaidman over 4 years ago

why-did-you-render - added "trackAllPureComponents" to typescript definitions and readme

Published by vzaidman over 4 years ago

why-did-you-render - improved typescript support + dev packages update

Published by vzaidman over 4 years ago

  • added typescript definition of whyDidYouRender to pure components
  • added typescript definition of trackExtraHooks to initialization options
  • updated all packages
why-did-you-render - hooks traching inner refactor

Published by vzaidman almost 5 years ago

why-did-you-render - Component.whyDidYouRender=false ensures the component is not tracked now

Published by vzaidman almost 5 years ago

why-did-you-render - added support for tracking custom hooks

Published by vzaidman almost 5 years ago

  • updated packages

  • fixed minor bugs and edge cases

  • improved readme

  • added support to tracking custom hooks:

If a hook returns new states when called, you can make sure WDYR checks that it doesnt recalculates a new "deep equals" object:

whyDidYouRender(React, {trackExtraHooks: [
  [Redux, 'useSelector']
]});

and then

Component.whyDidYouRender = true;
why-did-you-render -

Published by vzaidman almost 5 years ago

Fixed "module" not being defined in certain cases (#72)

why-did-you-render -

Published by vzaidman about 5 years ago

fixed a small edge case (#66) where memo is used on a string like this:

const Svg = React.memo("svg");
Svg.whyDidYouRender = true;

https://codesandbox.io/s/welldone-softwarewhy-did-you-render-memo-a-text-example-pzn3b

why-did-you-render - Improved Typescript Types

Published by vzaidman about 5 years ago

  • Improved Typescript Types #64 (Thanks @Genhain)
  • Updated Dev Packages

fixes #59

why-did-you-render - Added support to React.memo(ClassComponent)

Published by vzaidman about 5 years ago

  • fixed #50 - Doesn't work with class components wrapped in React.memo
  • also improved tests
  • refactored the code- abstracted some repeated code
  • updated packages, including dev packages with security issues
why-did-you-render - Fixed an issue with Strict mode in React 16.9.0

Published by vzaidman about 5 years ago

why-did-you-render - updated tests to use latest versions of all packages including React 16.9

Published by vzaidman about 5 years ago

why-did-you-render - styled-components support + fixed warnings on forwardref use

Published by vzaidman about 5 years ago

  • made sure no unexpected console warns arise when using styled-components or in some forward ref scenarios