Update options when updating state.

This commit is contained in:
Jake Archibald
2020-08-25 16:54:01 +01:00
parent 4e5a810770
commit 0abb6f18ba

View File

@ -134,6 +134,9 @@ export default class AVIFEncoderOptions extends Component<Props, State> {
speed: maxSpeed - optionState.effort,
};
// Updating options, so we don't recalculate in getDerivedStateFromProps.
newState.options = newOptions;
this.setState(
// It isn't clear to me why I have to cast this :)
newState as State,