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

[BUG] Componente re-render always i change any state #72

Closed
Gustavoaz opened this issue Oct 4, 2019 · 4 comments
Closed

[BUG] Componente re-render always i change any state #72

Gustavoaz opened this issue Oct 4, 2019 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Gustavoaz
Copy link

Gustavoaz commented Oct 4, 2019

Describe the bug
Componente re-render always i change any state. I want re-render specific component in, not powerbi

To Reproduce
Change any state and component re-render

Expected behavior
Not re-render when i change some state

@Gustavoaz Gustavoaz added the bug Something isn't working label Oct 4, 2019
@akshay5995
Copy link
Owner

Hi @Gustavoaz, I've got a few questions:

  1. What do you mean by any state ?
  2. Where is your Report component placed on the DOM tree? (If your Report is under some Parent component whose state is dynamic then your Child i.e, Report will re-render when the parent re-renders.)

@Gustavoaz
Copy link
Author

Hi @akshay5995

  1. Any state on my specific component
  2. Yes, my Report is under some Parent.

I implemented method shouldComponentUpdate to stop with re-render and It worked. But i think this is not ideal solution.

@akshay5995
Copy link
Owner

akshay5995 commented Oct 10, 2019

React re-renders child component if the Parent component re-renders. What exactly is the issue with re-rendering ?. To solve this is the reason React has shouldComponentUpdate or React.memo. If I'm missing something please propose a solution.

@akshay5995
Copy link
Owner

akshay5995 commented Oct 31, 2019

Closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants