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.32k stars 199 forks source link

Stopped working #260

Open bayramn opened 2 years ago

bayramn commented 2 years ago

All of sudden app crashed and logs stopped working. I am on Expo Managed Flow. I didn't change anything and it does get enabled and called but no logs anymore.

mohito12 commented 1 year ago

Same here with CLI RN 0.70.0 . No logs or errors.

bayramn commented 1 year ago

Same here with CLI RN 0.70.0 . No logs or errors.

Glad you commented, as I was killing myself trying to figure what have I done wrong. What happened in your case? Did you just install or were you using it before?

mohito12 commented 1 year ago

Same here with CLI RN 0.70.0 . No logs or errors.

Glad you commented, as I was killing myself trying to figure what have I done wrong. What happened in your case? Did you just install or were you using it before?

First time install.

vrgimael commented 1 year ago

Also can't get it work anymore, and I've been able to use it in the same project in the past - very strange

Waltari10 commented 1 year ago

On RN 0.70.3 and not working. Has been working before in same project and the package has been a life saver 🙏

Could someone confirm if they have had the package work with 0.70.x or above?

aurimasniekis commented 1 year ago

I also have one project with the same current packages which currently works with no issues, and another project with the same version doesn't anymore.

I found a sandbox that was working and changed to the newest packages and it doesn't work anymore.

Work: https://codesandbox.io/s/nice-bouman-czdgli Doesn't work: https://codesandbox.io/s/amazing-river-kpd1pq

The sandbox stopped working after switching to React v17

giantslogik commented 1 year ago

Package didn't work for me.

bayramn commented 1 year ago

I emailed Vitali when I opened this issue but he said never tried it on React Native and couldn’t help. I tried ask follow up question on FlatList and Context data cuz there was sth to do with these but he didn’t respond. So I have given up.

kg-currenxie commented 10 months ago

"react-native": "0.73.0" here. Not working :/

module.exports = {
  presets: [
    'module:@react-native/babel-preset',
    '@babel/preset-typescript',
    [
      '@babel/preset-react',
      {
        importSource: '@welldone-software/why-did-you-render',
        runtime: 'automatic',
        development: true,
      },
    ],
  ],
  ...
import './wdyr'
import { AppRegistry } from 'react-native'
import App from './App'
import { name as appName } from './app.json'

AppRegistry.registerComponent(appName, () => App)
import React from 'react'

if (__DEV__) {
  const whyDidYouRender = require('@welldone-software/why-did-you-render')
  whyDidYouRender(React, {
    trackAllPureComponents: true,
  })

  console.log('whyDidYouRender enabled')
}
sergeylaptev commented 10 months ago

I’ve described the solution for react-native projects in this pull request https://github.com/welldone-software/why-did-you-render/pull/288