Upgrade to latest version introduced componentDidUpdate / DOM issues
See original GitHub issueDo you want to request a feature or report a bug? Bug (I think - certainly could be a problem with our implementation)
After upgrading from ^5.0.7 to latest (^7.1.1), mostly just to quiet deprecation warnings, I noticed that our message container div in our chat app was not scrolling all of the way to the bottom on new messages.
In componentDidUpdate()
, we determine if the message count changed and then set scrollTop
to the scrollHeight
. I noticed that scrollHeight
was no longer changing when a new message was received. I’m not sure why a change in react-redux
would alter how componentDidUpdate()
sees what should be a change to the DOM after render()
.
Reverting back to ^5.07 solved the issue.
We are using react ^16.3.2, react-dom ^16.3.2 & Chrome 76.0.3809.132.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Can you provide a simplified code example? Codesandbox.io is a good place to set that up.
Thank for the link. Seems to be an identical use case. I ended up moving the scrollHeight inspection to the child component.