Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FormList ] FormList 嵌套 FormList 的时候,会导致死循环 #2787

Closed
ShaoGongBra opened this issue Mar 1, 2024 · 13 comments
Closed
Labels
🐞 bug Something isn't working example Something about example to be published fixed, not be published

Comments

@ShaoGongBra
Copy link

tdesign-react 版本

1.5.1

重现链接

No response

重现步骤

内部的元素打印,会一直打印,最后导致浏览器卡死

期望结果

No response

实际结果

No response

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

Copy link
Contributor

github-actions bot commented Mar 1, 2024

👋 @ShaoGongBra,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@HaixingOoO HaixingOoO added the 🐞 bug Something isn't working label Mar 2, 2024
@ShaoGongBra
Copy link
Author

https://github.com/Tencent/tdesign-react/blob/develop/src/form/FormList.tsx#L171

这一个依赖里面的 fields 去掉,就不会导致死循环,暂时也没发现什么问题,麻烦看一下

@HaixingOoO
Copy link
Collaborator

https://github.com/Tencent/tdesign-react/blob/develop/src/form/FormList.tsx#L171

这一个依赖里面的 fields 去掉,就不会导致死循环,暂时也没发现什么问题,麻烦看一下

好的,我们讨论然后排查一下

@ShaoGongBra
Copy link
Author

这个死循环,很奇怪,有的的表单嵌套会有,有的嵌套又不会有,还没发现规律

@HaixingOoO
Copy link
Collaborator

这个死循环,很奇怪,有的的表单嵌套会有,有的嵌套又不会有,还没发现规律

您好,可以提供个可以导致死循环的CodeSandBox我们嘛?

@ShaoGongBra
Copy link
Author

这个不好搞呀,太麻烦了,那个写好的代码是动态生成的表单,好像 FormList不需要套FormList也会出现,有多个平级FormList的时候也会

@HaixingOoO
Copy link
Collaborator

这个不好搞呀,太麻烦了,那个写好的代码是动态生成的表单,好像 FormList不需要套FormList也会出现,有多个平级FormList的时候也会

行,因为你也说了有的话有的不会,不清楚我们能不能复现,所以你能提供肯定是最好的!!!

@HaixingOoO HaixingOoO added the example Something about example label Mar 4, 2024
@ShaoGongBra
Copy link
Author

会死循环的其中一个表单是这样的

微信截图_20240304150607
微信截图_20240304150619

@HaixingOoO
Copy link
Collaborator

也可能是渲染多个formlist导致的卡死,#2040

@ShaoGongBra
Copy link
Author

不是,我改了这个之后就好了,我一步步调试到这,这个useEffect里面会一直执行

https://github.com/Tencent/tdesign-react/blob/develop/src/form/FormList.tsx#L171

这一个依赖里面的 fields 去掉,就不会导致死循环,暂时也没发现什么问题,麻烦看一下

@ShaoGongBra
Copy link
Author

我看你们这个同一个表单下多个 formlist 会互相调用更新数据,即便他们应该是没上下级关系的,不知道为什么

@ShaoGongBra
Copy link
Author

调用次数等于 formlist的个数的平方 有的情况下这个调用次数循环一次不会执行了,产生死循环的情况下,会一直循环调用下去

@uyarn uyarn added the to be published fixed, not be published label Mar 5, 2024
@HaixingOoO
Copy link
Collaborator

fixed 1.5.3!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working example Something about example to be published fixed, not be published
Projects
None yet
Development

No branches or pull requests

3 participants