G6 icon indicating copy to clipboard operation
G6 copied to clipboard

[V5]The custom node will call drawKeyShape when the construction of the custom node is not completely completed, resulting in an exception

Open zmbxy opened this issue 6 months ago • 5 comments

Describe the bug / 问题描述

自定义节点时,通过debug打印执行顺序发现,自定义节点时,在constructor中完成super调用后,在执行constructor中super之后代码之前,执行drawKeyShape,此时,由于自定义节点未完成构造,导致在drawKeyShape中提前访问了未配置好的数据,出现异常错误。

image

Reproduction link / 重现链接

https://stackblitz.com/edit/vitejs-vite-wfzclz?file=src%2FApp.tsx

Steps to Reproduce the Bug or Issue / 重现步骤

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

macOS

Browser / 浏览器

Chrome

Additional context / 补充说明

No response

zmbxy avatar Aug 23 '24 04:08 zmbxy