Skip to content

Commit

Permalink
Merge pull request #172 from Sitebase/chore/update-react-16
Browse files Browse the repository at this point in the history
[react] update to React 16
  • Loading branch information
JorgenEvens authored Sep 14, 2019
2 parents 66eb93b + d08e9d9 commit 151370a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@types/react": "^15.0.0",
"@types/react": "^16.0.0",
"babel-eslint": "^6.0.0",
"babel-loader": "^8.0.2",
"eslint": "^1.10.3",
"eslint-loader": "^2.1.0",
"eslint-plugin-react": "^4.3.0",
"file-loader": "^2.0.0",
"gh-pages": "^1.2.0",
"react": "^15.0.0",
"react-dom": "^15.0.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"webpack": "^4.19.0",
"webpack-bundle-analyzer": "^3.0.2",
"webpack-cli": "^3.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ class Avatar extends PureComponent {
this.fetch();
}

componentWillReceiveProps(newProps) {
componentDidUpdate(prevProps) {
let needsUpdate = false;

// This seems redundant
//
// Props that need to be in `state` are
// `value`, `src` and `color`
for (const prop in sourcePropTypes)
needsUpdate = needsUpdate || (newProps[prop] !== this.props[prop]);
needsUpdate = needsUpdate || (prevProps[prop] !== this.props[prop]);

if (needsUpdate)
setTimeout(this.fetch, 0);
Expand Down

0 comments on commit 151370a

Please sign in to comment.