-
Notifications
You must be signed in to change notification settings - Fork 300
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
Allow passing flatListProps #21
Conversation
Set the windowSize property of FlatList to default 3.
src/Gallery.js
Outdated
scrollViewStyle: {} | ||
scrollViewStyle: {}, | ||
flatListProps: { | ||
windowSize: 3, |
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.
Maybe we should set this windowSize
value directly where we render Flatlist
to make sure this isn't overriden when the users use flatListProps
prop.
Or, we would have to merge the default value and the user's one.
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.
Yup. Makes sense. The soonest I'll be able to fix this is on Monday.
src/Gallery.js
Outdated
@@ -265,9 +267,12 @@ export default class Gallery extends PureComponent { | |||
gestureResponder = {}; | |||
} | |||
|
|||
const flatListProps = Object.assign(DEFAULT_FLAT_LIST_PROPS, this.props.flatListProps) |
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.
Much better ! Could you use the spread operator here to keep the codebase more consistant ?
Look good, I'll test this on the demo and merge it tomorrow. |
Can you add it in the README's props table as well ? |
Great! Thanks! |
Any chance of pushing to npm, @Exilz ? |
@vbuch published as |
Thanks a bunch! |
Set the windowSize property of FlatList to default 3.
#19