-
Notifications
You must be signed in to change notification settings - Fork 45.6k
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: Unnecessary re-render #18719
Comments
Does this happen with the production build as well? I'm asking because it doesn't actually commit when transitioning from 2->2. You can observe this wrapping the (side-effect) in React.useEffect(() => {
console.log("render App", x);
}) |
Also: Probably a duplicate of #14994 |
@eps1lon Yes It's happen |
Fairly certain this is a duplicate of #14994. |
@eps1lon Thanks, but every solution is awful. |
I can understand why this might be undesired behavior for you. But this won't get solved by keeping duplicate issues open which require maintenance from the core team. It also helps keeping the discussion focused so that potential workarounds aren't spread over the repository. |
@eps1lon All right, I'll close it |
React version: 16.13.1
Steps To Reproduce
1- The first render is correct
2- The second re-render is correct because
X
changes from1
to2
3- The third re-render in the wrong
Link to code example:
https://codesandbox.io/s/bug-in-render-ldycb
The current behavior
The third re-render is unnecessary but happen
The expected behavior
The third re-render should not happen
The text was updated successfully, but these errors were encountered: