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

[Field]unmount custom function component but value in field still exists #4875

Closed
ilovejcm opened this issue Jul 2, 2024 · 5 comments
Closed
Labels
💬 Discussion Stale not active for a lone time

Comments

@ilovejcm
Copy link

ilovejcm commented Jul 2, 2024

Component

Field

Reproduction link

https://hitu.antgroup-inc.cn/codeblocks/8b97b84a

Steps to reproduce

Expect: auto clear value in field when custom function component has been unmounted just like other fusion components dose

Copy link

github-actions bot commented Jul 2, 2024

这是您为 Fusion/Next 提的第一个 issue,感谢您对 Fusion 的信任和支持,我们会尽快进行处理。

@FairyYang
Copy link
Collaborator

因为自定义组件是函数式组件,没有ref,造成field 无法跟进组件状态。提供一种解决方案,将函数式组件包裹forwardRef,示例:https://hitu.antgroup-inc.cn/codeblocks/7b3abf8b

Copy link

你好,该 issue 已 30 天没有活动,因此被标记为 stale,如果之后的 7 天仍然没有活动,该 issue 将被自动关闭

@github-actions github-actions bot added the Stale not active for a lone time label Aug 15, 2024
@chi-gao
Copy link

chi-gao commented Dec 3, 2024

https://hitu.antgroup-inc.cn/codeblocks/7b3abf8b

你好,请问使用forwardRef包裹的自定义组件如果是非Fusion原生组件呢? 需要做什么额外处理吗? 比如我这边依赖的是monaco-editor组件,貌似使用ref包裹后反而拿不到value的值了。

可以参考这个例子: https://hitu.antgroup-inc.cn/codeblocks/1ce6737e

@FairyYang
Copy link
Collaborator

FairyYang commented Dec 3, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💬 Discussion Stale not active for a lone time
Projects
None yet
Development

No branches or pull requests

4 participants