See the issue and the test case with original fix in https://github.com/facebook/react/pull/14802.

We'll need to fix it properly, see https://github.com/facebook/react/pull/14802#issuecomment-463277621.
if (nextProps.value === prevState.value) {
          return null;
        }
        return {value: nextProps.value};
      }
      shouldComponentUpdate(nextProps, nextState) {
        return nextState.value !== this.state.value;
      }
      render() {
        return <div>{`value:${this.state.value}`}</div>;
      }
    }
    const shallowRenderer = createRenderer();
    const initialResult = shallowRenderer.render(
      <SimpleComponent value="initial" />,
    );
    expect(initialResult).toEqual(<div>value:initial</div>);
    const updatedResult = shallowRenderer.render(
      <SimpleComponent value="updated" />,
    );
    expect(updatedResult).toEqual(<div>value:updated</div>);
  });
  it('can setState with an updater function', () => {
    let instance;
    class SimpleComponent extends React.Component {