mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 08:55:44 +01:00
add additional precautious check
This commit is contained in:
@@ -74,7 +74,7 @@ class Diff extends React.Component<Props, State> {
|
|||||||
shouldComponentUpdate(nextProps: Readonly<Props>, nextState: Readonly<State>): boolean {
|
shouldComponentUpdate(nextProps: Readonly<Props>, nextState: Readonly<State>): boolean {
|
||||||
// We have check if the contentRef changed and update afterwards so the page can scroll to the anchor links.
|
// We have check if the contentRef changed and update afterwards so the page can scroll to the anchor links.
|
||||||
// Otherwise it can happen that componentDidUpdate is never executed depending on how fast the markdown got rendered
|
// Otherwise it can happen that componentDidUpdate is never executed depending on how fast the markdown got rendered
|
||||||
return this.state.contentRef !== nextState.contentRef;
|
return this.state.contentRef !== nextState.contentRef || this.props !== nextProps;
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
Reference in New Issue
Block a user