Show wrong code - Props check using if else

This will break when props updates are batched, say from onclick event
(like the last button here)
This commit is contained in:
Abhas
2018-12-26 11:36:35 +05:30
parent f7dd7884af
commit 6b37eee232
+1 -3
View File
@@ -26,9 +26,7 @@ export default class SectionManager extends Component {
if (scrollProps.sectionName !== oldScrollProps.sectionName) {
this.scrollToSection(scrollProps.sectionName)
}
if (postProps.postNumber !== oldPostProps.postNumber) {
} else if (postProps.postNumber !== oldPostProps.postNumber) {
this.updateSectionBody(postProps.postNumber);
}
}