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
Bot releases are visible (Hide)
Published by vzaidman almost 6 years ago
based on how react does it:
https://overreacted.io/how-does-react-tell-a-class-from-a-function/
Published by vzaidman almost 6 years ago
thanks @spiral2k for the idea
Published by vzaidman almost 6 years ago
This helps us to patch functional components "less" and prepares us for React Hooks.
Published by vzaidman almost 6 years ago
In Next.js and we assume in other complicated cases, for some reason, inheritance of Component from another Component that inherits from React, doesn't work. Monkey patching render from the other hand does works.
Tested on a complex next.js project.
Published by vzaidman almost 6 years ago
Turns out some libraries use render like this:
render = () => {
This means they don't have render
in their class prototype.
This version can handle it just right.
Published by vzaidman almost 6 years ago