public componentWillReceiveProps()

in frontend/src/common/components/hocr/hocr-preview/hocr-preview.component.tsx [149:167]


  public componentWillReceiveProps(nextProps: HocrPreviewProps) {
    if( this.props.hocr !== nextProps.hocr ||
        this.props.pageIndex !== nextProps.pageIndex ||
        this.props.targetWords !== nextProps.targetWords ||
        this.props.caseSensitiveComparison !== nextProps.caseSensitiveComparison
    ) {
      this.setState({
        ...this.state,
        ...this.calculateStateFromProps(nextProps),
      }, this.onStateUpdated);
    } else if ( this.props.userStyle != nextProps.userStyle ) {
      this.setState({
        ...this.state,
        safeStyle: injectDefaultPreviewStyle(nextProps.userStyle),
      });
    } else if ( this.props.autoFocusId != nextProps.autoFocusId ) {
      this.autoFocusToNode(nextProps.autoFocusId);
    };
  }