Skip to content

Commit 4f9ee5e

Browse files
vonovakM-i-k-e-l
authored andcommitted
fix shouldComponentUpdate in YellowBox (facebook#25097)
Summary: The previous comparison does not make sense (accessing props by index) - and always returns true. I'm going to assume there was a reason for implementing `shouldComponentUpdate` - although personally I'd just go for PureComponent (even if it may not be 100% accurate). Let me know if PureComponent sounds better. ## Changelog not needed Pull Request resolved: facebook#25097 Differential Revision: D15575079 Pulled By: cpojer fbshipit-source-id: 49aeb9d2997d3c613fe7a1af4534dff1607d53b4
1 parent 898a1a5 commit 4f9ee5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Libraries/YellowBox/UI/YellowBoxListRow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class YellowBoxListRow extends React.Component<Props> {
3838
prevProps.onPress !== nextProps.onPress ||
3939
prevProps.warnings.length !== nextProps.warnings.length ||
4040
prevProps.warnings.some(
41-
(prevWarning, index) => prevWarning !== nextProps[index],
41+
(prevWarning, index) => prevWarning !== nextProps.warnings[index],
4242
)
4343
);
4444
}

0 commit comments

Comments
 (0)