From f9f8ed266d815dfb18d8ac2b3fba500ddfe7443a Mon Sep 17 00:00:00 2001 From: Crux Date: Tue, 3 Apr 2018 14:56:07 +0900 Subject: [PATCH] Update on className change --- tweet-embed.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tweet-embed.js b/tweet-embed.js index ed1a1be..5943b48 100644 --- a/tweet-embed.js +++ b/tweet-embed.js @@ -47,11 +47,16 @@ class TweetEmbed extends React.Component { } shouldComponentUpdate (nextProps, nextState) { - return this.props.id !== nextProps.id + return ( + this.props.id !== nextProps.id || + this.props.className !== nextProps.className + ) } componentWillUpdate (nextProps, nextState) { - this.loadTweetForProps(nextProps) + if (this.props.id !== nextProps.id) { + this.loadTweetForProps(nextProps) + } } render () {