From 0abb6f18ba90a093e1ab97689ee2eb9dd794c527 Mon Sep 17 00:00:00 2001 From: Jake Archibald Date: Tue, 25 Aug 2020 16:54:01 +0100 Subject: [PATCH] Update options when updating state. --- src/codecs/avif/options.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/codecs/avif/options.tsx b/src/codecs/avif/options.tsx index 41d98044..a5533ca1 100644 --- a/src/codecs/avif/options.tsx +++ b/src/codecs/avif/options.tsx @@ -134,6 +134,9 @@ export default class AVIFEncoderOptions extends Component { 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,