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

希望支持动态初始化 #16

Open
adam-tan opened this issue Jun 20, 2021 · 2 comments
Open

希望支持动态初始化 #16

adam-tan opened this issue Jun 20, 2021 · 2 comments

Comments

@adam-tan
Copy link

在config改变的时候,能重新初始化,基于某些场景,一个组件改变后,需要改同一个timePicker的默认时间,以及时间范围等等选项

@rover95
Copy link
Owner

rover95 commented Jun 22, 2021

初衷并不是做成无状态组件,组件内部自己控制picker的各种状态,config仅为初始化参数,动态变更可以可以考虑动态销毁组件重新生成

@adam-tan
Copy link
Author

adam-tan commented Jul 5, 2021

动态初始化,并不会把它改成无状态组件,只是config改变的时候会再次初始化而已,初始化之后的各种状态也是由组件自己控制,antd的日期组件,也是可以动态初始化的,动态销毁组件这种形式,无疑会无端增加代码复杂度

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants