Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't show anything in console #57

Closed
HugoLiconV opened this issue Sep 8, 2019 · 6 comments
Closed

Doesn't show anything in console #57

HugoLiconV opened this issue Sep 8, 2019 · 6 comments

Comments

@HugoLiconV
Copy link

I don't know what I'm doing wrong, but nothing is shown in the console.

This is how I set it up:
I execute whyDidYouRender in index.tsx like this:

if (process.env.NODE_ENV !== 'production') {
  const whyDidYouRender = require('@welldone-software/why-did-you-render');
  whyDidYouRender(React);
}

ReactDOM.render(<App />, document.getElementById('root'));

And I added the static property whyDidYouRender to App.tsx
App.whyDidYouRender = true;

I don't know if I missing something

@mikalai-sauchanka
Copy link

I have same issue. I used "why-did-you-update" before, but it stopped working.
Is there a "debug" mode to troubleshoot?

@vzaidman
Copy link
Collaborator

vzaidman commented Sep 9, 2019

probably app just doest re-render without a reason.
try to see if this triggers logs

ReactDOM.render(<App />, document.getElementById('root'));
ReactDOM.render(<App />, document.getElementById('root'));

@mikalai-sauchanka
Copy link

OK. In my case it was a typescript setting in tsconfig.json. Changed "module" from "commonjs" to "ES6"...

@vzaidman
Copy link
Collaborator

vzaidman commented Sep 9, 2019

great!

@vzaidman vzaidman closed this as completed Sep 9, 2019
@HugoLiconV
Copy link
Author

probably app just doest re-render without a reason.
try to see if this triggers logs

ReactDOM.render(<App />, document.getElementById('root'));
ReactDOM.render(<App />, document.getElementById('root'));

this worked for me, thanks!

@vzaidman
Copy link
Collaborator

vzaidman commented Sep 9, 2019

I guess you might benefit from reading about the library and what it concederes "redundant re-renders" here:
http://bit.ly/wdyr1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants