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

请教代码设计思路 #277

Open
DerrickTel opened this issue Dec 31, 2021 · 1 comment
Open

请教代码设计思路 #277

DerrickTel opened this issue Dec 31, 2021 · 1 comment

Comments

@DerrickTel
Copy link

DerrickTel commented Dec 31, 2021

if (mergedValue !== newValue && onChangeRef.current) {

这里为什么要加这么一个判断,如果修改的值变成和默认值一样,这个函数就不执行了。是为了解决哪个问题?

@DerrickTel
Copy link
Author

DerrickTel commented Dec 31, 2021

现在有个bug,当传入的值和默认值一致时,发现函数没有调用了。看了源码才知道是这个原因,当时是为了解决哪个问题?或者说哪个场景,我说的这个场景应该怎么处理?

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

1 participant