Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
Don't let FollowTagButton pass reduntant props to IconComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
artkravchenko committed Sep 19, 2016
1 parent 6513a42 commit 9be786c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/follow-tag-button.js
Expand Up @@ -17,6 +17,7 @@
*/
import React, { PropTypes } from 'react';
import ga from 'react-google-analytics';
import { omit } from 'lodash';

import { CurrentUser as CurrentUserPropType } from '../prop-types/users';

Expand All @@ -34,7 +35,6 @@ export default class FollowTagButton extends React.Component {
static displayName = 'FollowButton';
static propTypes = {
current_user: CurrentUserPropType,
// {tagName: tag}
followed_tags: PropTypes.shape({}),
tag: PropTypes.string,
triggers: PropTypes.shape({
Expand Down Expand Up @@ -101,9 +101,7 @@ export default class FollowTagButton extends React.Component {
return null;
}

const buttonProps = { ...props };
delete buttonProps.tag;
delete buttonProps.triggers;
const buttonProps = omit(props, Object.keys(FollowTagButton.propTypes));

// If followTag or unfollowTag was performed
if (status !== STATUS_NOT_TOUCHED) {
Expand Down

0 comments on commit 9be786c

Please sign in to comment.