message: Work for - Introduce lazy rendering mode for page/panel rows content - lazy rows rendering for survey-react
diff: @@ -6,6 +6,7 @@ import { Question } from "../question";
  import { SurveyElementBase } from "./reactquestionelement";
  import { IElement, Base } from "../base";
  import { ReactElementFactory } from "./element-factory";
  +import { settings } from "../settings";
  export class SurveyRow extends SurveyElementBase {
  constructor(props: any) {
  @@ -30,13 +31,35 @@ export class SurveyRow extends SurveyElementBase {
  if (this.row == null || this.survey == null || this.creator == null)
  return null;
  if (this.row.visible) {
  - var elements = this.row.elements.map(element =>
  + var elements = null;
  + if (this.row.isNeedRender) {
  + elements = this.row.elements.map((element) =>
  this.createElement(element)
  );
  - return <div className={this.css.row}>{elements}</div>;
  + }
  + return (
  + <div ref="root" className={this.css.row}>
  + {elements}
  + </div>
  + );
  }
  return null;
  }
  + componentDidMount() {
  + super.componentDidMount();
  + var el: any = this.refs["root"];
  + if (!!el) {
  + if (!this.row.isNeedRender) {
  + var rowContainerDiv = el;
  + this.row.lazyRenderingBehavior(rowContainerDiv, this.row);
  + }
  + }
  + }
  + componentWillUnmount() {
  + super.componentWillUnmount();
  + this.row.isNeedRender = !settings.lazyRowsRendering;
  + }
  +
  protected createElement(element: IElement): JSX.Element {
  var elementType = element.getType();
  if (!ReactElementFactory.Instance.isElementRegisgered(elementType)) {
  @@ -47,7 +70,7 @@ export class SurveyRow extends SurveyElementBase {
  element: element,
  creator: this.creator,
  survey: this.survey,
  - css: this.css
  + css: this.css,
  });
  }
  }
  