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.11k stars 196 forks source link

`trackAllPureComponents: true` is not working #294

Open Sheikh45 opened 5 months ago

Sheikh45 commented 5 months ago

Functional Component in React.Memo(Component) is not working, no logs or anything shows.

import React from 'react';

if (process.env.NODE_ENV === 'development') {
  const whyDidYouRender = require('@welldone-software/why-did-you-render');
  whyDidYouRender(React, {
    trackAllPureComponents: true,
  });
}

and importing it as first line in index.js

import './wdyr';
import React from 'react';

I am using CRA v5.0.1 and react v18.2.0 while the WDYR is v8.0.1 as devDependency

skanehira commented 1 month ago

same as...