Skip to content
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

Merged
merged 4 commits into from Oct 2, 2017
Merged

Allow passing flatListProps #21

merged 4 commits into from Oct 2, 2017

Conversation

vbuch
Copy link
Contributor

@vbuch vbuch commented Sep 21, 2017

Set the windowSize property of FlatList to default 3.
#19

Set the windowSize property of FlatList to default 3.
src/Gallery.js Outdated
scrollViewStyle: {}
scrollViewStyle: {},
flatListProps: {
windowSize: 3,
Copy link
Contributor

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.

Copy link
Contributor Author

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)
Copy link
Contributor

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 ?

@Exilz
Copy link
Contributor

Exilz commented Sep 25, 2017

Look good, I'll test this on the demo and merge it tomorrow.

@Exilz
Copy link
Contributor

Exilz commented Sep 26, 2017

Can you add it in the README's props table as well ?

@Exilz Exilz merged commit 538fad7 into meliorence:master Oct 2, 2017
@vbuch
Copy link
Contributor Author

vbuch commented Oct 3, 2017

Great! Thanks!

@vbuch
Copy link
Contributor Author

vbuch commented Oct 3, 2017

Any chance of pushing to npm, @Exilz ?

@Exilz
Copy link
Contributor

Exilz commented Oct 3, 2017

@vbuch published as 2.1.0

@vbuch
Copy link
Contributor Author

vbuch commented Oct 3, 2017

Thanks a bunch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants