refactor: stop using unsafe or deprecated React methods (#1542)

This commit is contained in:
Caleb
2018-07-31 14:59:22 -06:00
committed by Shawn Erquhart
parent 95c744ee3e
commit d5f59de2d2
10 changed files with 53 additions and 57 deletions

View File

@ -91,8 +91,8 @@ export default function withFileControl({ forImage } = {}) {
return false;
}
componentWillReceiveProps(nextProps) {
const { mediaPaths, value, onRemoveInsertedMedia, onChange } = nextProps;
componentDidUpdate() {
const { mediaPaths, value, onRemoveInsertedMedia, onChange } = this.props;
const mediaPath = mediaPaths.get(this.controlID);
if (mediaPath && mediaPath !== value) {
onChange(mediaPath);