Skip to content

Commit

Permalink
Fix getDerivedStateFromProps
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Feb 15, 2019
1 parent dfc532c commit f96dbe0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/format-library/src/image/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ export const image = {
}

static getDerivedStateFromProps( props, state ) {
const { value, activeAttributes: { style } } = props;
const { activeAttributes: { style } } = props;

if ( value.start === state.previousStart ) {
if ( style === state.previousStyle ) {
return null;
}

if ( ! style ) {
return {
width: undefined,
previousStart: value.start,
previousStyle: style,
};
}

return {
width: style.replace( /\D/g, '' ),
previousStart: value.start,
previousStyle: style,
};
}

Expand Down

0 comments on commit f96dbe0

Please sign in to comment.