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

fix(Pagination): allow to override props in PaginationItem #2537

Merged
merged 3 commits into from
Feb 25, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/addons/Pagination/PaginationItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class PaginationItem extends Component {

render() {
const { active, ariaLabel, type, ...rest } = this.props
const disabled = type === 'ellipsisItem'
const disabled = rest.disabled || type === 'ellipsisItem'
Copy link
Member

Choose a reason for hiding this comment

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

This sort of makes me wonder why rest props aren't spread after all other props below, see lines 72-79. Usually, the user's props should always "win".

@layershifter is there a reason for this or what is it an oversight? Also, shouldn't the props passed to the MenuItem factory be passed as { defaultProps: { ... } } so that they don't override the users rest props?

Copy link
Member

Choose a reason for hiding this comment

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

Yep, it's my miss. I will check this PR on this weekend


return MenuItem.create({
...rest,
Expand Down