mirror of
https://github.com/bendtherules/react-props-change.git
synced 2026-08-18 13:53:28 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user