Skip to content

Support custom item render in GridView #1775

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

Merged
merged 2 commits into from
Jan 18, 2022
Merged

Conversation

ethanshar
Copy link
Collaborator

Description

Support renderCustomItem in GridView

Changelog

Support renderCustomItem prop in GridView

@ethanshar ethanshar changed the title Suport custom item render in GridView Support custom item render in GridView Jan 11, 2022
@ethanshar ethanshar requested a review from M-i-k-e-l January 11, 2022 09:16
children: isLastItem ? this.renderLastItemOverlay() : undefined
};

return renderCustomItem ? renderCustomItem(itemProps) : <GridListItem {...itemProps}/>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't usually send (as far as I remember) our configuration to the custom render function, is this a new approach or a special case?
Also, I feel like the name (item in the definition above) should be more along "suggested props" if this is how it's called, not sure how to call it though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand the comment.
What you mean by configuration?

What I did is just pass the props I usually pass to GridListItem to the custom render so it can use it.
Technically, we render in private a wrapper of GridListItem (check the private PR)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I totally missed the email from private (probably archived it, thinking it's the same one).

@ethanshar ethanshar requested a review from M-i-k-e-l January 12, 2022 10:26
@ethanshar ethanshar merged commit a60dad6 into master Jan 18, 2022
@ethanshar ethanshar deleted the feat/GridViewCustomItem branch April 18, 2022 09:03
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.

3 participants