message: Fix: React: remove subscription in matrix dynamic on row count changed
diff: @@ -11,7 +11,7 @@ import {
  QuestionMatrixDropdownRenderedCell,
  MatrixDropdownCell,
  AdaptiveActionContainer,
  - Question
  + Question,
  } from "survey-core";
  import { SurveyQuestionCheckboxItem } from "./reactquestion_checkbox";
  import { SurveyQuestionRadioItem } from "./reactquestion_radiogroup";
  @@ -31,24 +31,23 @@ export class SurveyQuestionMatrixDropdownBase extends SurveyQuestionElementBase
  private getState(prevState: any = null) {
  return { rowCounter: !prevState ? 0 : prevState.rowCounter + 1 };
  }
  - private updateVisibleRowsChangedCallback() {
  + private updateStateOnCallback() {
  + if (this.isRendering) return;
  + this.setState(this.getState(this.state));
  + }
  + componentDidMount() {
  + super.componentDidMount();
  this.question.visibleRowsChangedCallback = () => {
  this.updateStateOnCallback();
  };
  - }
  - private renderedTableResetCallback() {
  this.question.onRenderedTableResetCallback = () => {
  this.updateStateOnCallback();
  };
  }
  - private updateStateOnCallback() {
  - if (this.isRendering) return;
  - this.setState(this.getState(this.state));
  - }
  - componentDidMount() {
  - super.componentDidMount();
  - this.updateVisibleRowsChangedCallback();
  - this.renderedTableResetCallback();
  + componentWillUnmount() {
  + super.componentWillUnmount();
  + this.question.visibleRowsChangedCallback = undefined;
  + this.question.onRenderedTableResetCallback = undefined;
  }
  protected renderElement(): JSX.Element {
  return this.renderTableDiv();
  @@ -98,9 +97,7 @@ export class SurveyQuestionMatrixDropdownBase extends SurveyQuestionElementBase
  }
  return (
  <thead>
  - <tr>
  - {headers}
  - </tr>
  + <tr>{headers}</tr>
  </thead>
  );
  }
  