lowcode-engine icon indicating copy to clipboard operation
lowcode-engine copied to clipboard

物料渲染两遍的问题

Open Ewall1106 opened this issue 3 years ago • 0 comments

Describe the bug (required) / 详细描述 bug(必填)

在画布侧或者预览侧,物料都会渲染两遍。


To Reproduce (required) / 如何复现 bug?(必填,非常重要)

Steps to reproduce the behavior: / 详细复现步骤:

1、通过官方脚手架初始化一个物料

2、添加一行console.log打印属性信息

import * as React from "react";

interface ComponentProps {
  title: string;
}

const TestButton = (props: ComponentProps) => {
  console.log("TestButton Props", props); // =====这里打印一下props=====

  return <div {...others}>{title}</div>;
};

TestButton.displayName = "TestButton";

export default TestButton;

3、启动 npm run lowcode:dev 在控制台会看到物料会打印两次 image

4、点击预览按钮,预览页面中也会打印两次。 image

P.S 如果给ReactRenderer组件设置appHelper属性,就不会重复渲染。 image

Environments (please complete the following information) (required): / 请提供如下信息(必填)

  • "@alilc/lowcode-react-renderer": "^1.0.13"

Ewall1106 avatar Aug 12 '22 03:08 Ewall1106