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

error: TypeError: Super expression must either be null or a function #118

Closed wizevlad closed 4 years ago

wizevlad commented 4 years ago

92

vzaidman commented 4 years ago

Copied from #92 since this is another error:

I have react-redux v7.2.0. and why-did-you-render v4.2.0. Got this error:

Screen Shot 2020-05-11 at 12 48 55 PM image

Readable:

error: TypeError: Super expression must either be null or a function
vzaidman commented 4 years ago

can you please specify in what scenario it happens?

i use react redux 7.2, and the library is tested with it so it has to be something more specific.

you can use the unminimized version of the library to debug it:

  let whyDidYouRender = require('@welldone-software/why-did-you-render/dist/cjs/whyDidYouRender.js')
  let ReactRedux = require('react-redux')
  whyDidYouRender(React, {
    trackAllPureComponents: true,
  })

also, make sure your "why did you render" is up to date

vzaidman commented 4 years ago

closing for now, but @wizevlad, you can re-open when when you have more info.