F 修复发布过程中切换页面可能会引起页面异常的问题

pull/161/head
vapao 2020-07-22 22:33:31 +08:00
parent 3ba249e0a2
commit d0043d7ff6
2 changed files with 6 additions and 2 deletions

View File

@ -18,7 +18,9 @@ class OutView extends React.Component {
}
componentDidUpdate(prevProps, prevState, snapshot) {
setTimeout(() => this.el.scrollTop = this.el.scrollHeight, 100)
setTimeout(() => {
if (this.el) this.el.scrollTop = this.el.scrollHeight
}, 100)
}
render() {

View File

@ -16,7 +16,9 @@ class OutView extends React.Component {
}
componentDidUpdate(prevProps, prevState, snapshot) {
setTimeout(() => this.el.scrollTop = this.el.scrollHeight, 100)
setTimeout(() => {
if (this.el) this.el.scrollTop = this.el.scrollHeight
}, 100)
}
render() {