-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bugfix][FlatList] Objects as props trigger invariant errors #16776
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ const React = require('React'); | |
const View = require('View'); | ||
const VirtualizedList = require('VirtualizedList'); | ||
|
||
const invariant = require('fbjs/lib/invariant'); | ||
const invariant = require('fbjs/lib/invariant'), areEqual = require('fbjs/lib/areEqual'); | ||
|
||
import type {StyleObj} from 'StyleSheetTypes'; | ||
import type { | ||
|
@@ -419,16 +419,15 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> { | |
'changing the number of columns to force a fresh render of the component.', | ||
); | ||
invariant( | ||
nextProps.onViewableItemsChanged === this.props.onViewableItemsChanged, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. prettier/prettier: Replace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ??? |
||
areEqual(nextProps.onViewableItemsChanged, this.props.onViewableItemsChanged), | ||
'Changing onViewableItemsChanged on the fly is not supported', | ||
); | ||
invariant( | ||
nextProps.viewabilityConfig === this.props.viewabilityConfig, | ||
areEqual(nextProps.viewabilityConfig, this.props.viewabilityConfig), | ||
'Changing viewabilityConfig on the fly is not supported', | ||
); | ||
invariant( | ||
nextProps.viewabilityConfigCallbackPairs === | ||
this.props.viewabilityConfigCallbackPairs, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. prettier/prettier: Replace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is it pointing to the prev version of the diff? |
||
areEqual(nextProps.viewabilityConfigCallbackPairs, this.props.viewabilityConfigCallbackPairs), | ||
'Changing viewabilityConfigCallbackPairs on the fly is not supported', | ||
); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier/prettier: Insert
⏎·