Skip to content

Commit 4cb3612

Browse files
authored
Merge pull request #22 from crux153/master
Update on className change
2 parents c372b91 + f9f8ed2 commit 4cb3612

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tweet-embed.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,16 @@ class TweetEmbed extends React.Component {
4747
}
4848

4949
shouldComponentUpdate (nextProps, nextState) {
50-
return this.props.id !== nextProps.id
50+
return (
51+
this.props.id !== nextProps.id ||
52+
this.props.className !== nextProps.className
53+
)
5154
}
5255

5356
componentWillUpdate (nextProps, nextState) {
54-
this.loadTweetForProps(nextProps)
57+
if (this.props.id !== nextProps.id) {
58+
this.loadTweetForProps(nextProps)
59+
}
5560
}
5661

5762
render () {

0 commit comments

Comments
 (0)