From 9be786c3a413c694de442e3e3a2eb65a9a5814fe Mon Sep 17 00:00:00 2001 From: Oopscurity Date: Mon, 19 Sep 2016 23:59:08 +0300 Subject: [PATCH] Don't let FollowTagButton pass reduntant props to IconComponent --- src/components/follow-tag-button.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/follow-tag-button.js b/src/components/follow-tag-button.js index cea4c334..742f63ab 100644 --- a/src/components/follow-tag-button.js +++ b/src/components/follow-tag-button.js @@ -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'; @@ -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({ @@ -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) {