diff --git a/content/blog/2018-05-23-react-v-16-4.md b/content/blog/2018-05-23-react-v-16-4.md index f65d58bd1..b6bb52387 100644 --- a/content/blog/2018-05-23-react-v-16-4.md +++ b/content/blog/2018-05-23-react-v-16-4.md @@ -62,7 +62,7 @@ One possible way to fix this is to compare the incoming value to the previous va ```js static getDerivedStateFromProps(props, state) { - const prevProps = state.prevProps; + const prevProps = state.prevProps || {}; // Compare the incoming prop to previous prop const controlledValue = prevProps.value !== props.value