alibaba / alibaba/lowcode-engine
低代码组件shouldComponentUpdate不生效
- Dominant language
- TypeScript
- Stars
- 15.9k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
## **Describe the bug (required)** / **详细描述 bug(必填)**
低代码组件中使用shouldComponentUpdate返回false,在低代码组件中更新state时可以执行shouldComponentUpdate方法。
在页面中更新state时,这个低代码组件的shouldComponentUpdate不会执行。
---
## **To Reproduce (required)** / **如何复现 bug?(必填,非常重要)**
Steps to reproduce the behavior: / 详细复现步骤:
1. 使用该仓库给低代码组件增加shouldComponentUpdate,返回false
https://github.com/alibaba/lowcode-demo/tree/main/demo-lowcode-component
2. 在页面中增加按钮加入点击事件更新state。
3. 控制台打印执行了低代码组件的componentDidUpdate,并没有触发shouldComponentUpdate。
4. 如果是低代码组件内事件更新了内部state,可以触发shouldComponentUpdate。
---
## **Expected behavior (required)** / **预期行为(必填,非常重要)**
A clear and concise description of what did you expect to happen. / 请清晰和精确的描述你预期的行为
想在低代码组件中使用shouldComponentUpdate来避免一些重渲染
---
## **Screenshots (optional)** / **bug 截图(可选)**
Sceenshots for further information. (If applicable.) / 一些有用的截图将会帮助我们更好的明确以及定位问题
---
## **Environments (please complete the following information) (required):** / **请提供如下信息(必填)**
- AliLowCodeEngine version: [e.g. 1.0.0] / 低代码引擎版本
- AliLowCodeEngineExt version: [e.g. 1.0.0] / 低代码引擎扩展包版本
- Browser [e.g. chrome, safari] / 浏览器版本
- materials / plugins / tools / 其他物料 / 插件 / 工具链版本
> (this information can be collected via [the manual plugin](https://img.alicdn.com/imgextra/i1/O1CN0115zonY1IsgbkZ2ir7_!!6000000000949-2-tps-3066-1650.png) / 版本信息可[通过低代码用户手册插件收集](https://img.alicdn.com/imgextra/i1/O1CN0115zonY1IsgbkZ2ir7_!!6000000000949-2-tps-3066-1650.png))
## **Additional context (optional)** / **更多额外信息(可选)**
Any other context of the problem here. / 可以追加更多的额外信息,帮助定位问题
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.