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

fix: Editor #48

Merged
merged 2 commits into from
Feb 27, 2022
Merged

fix: Editor #48

merged 2 commits into from
Feb 27, 2022

Conversation

FoundTheWOUT
Copy link
Contributor

#46 以前,每次修改通过 提交 按钮修改状态,可以保证 currentContent 获取到最新状态。该 PR 更新以后,部分表单通过valueChange 监听改变,状态改变后 currentContent 没有更新,导致进行下一次修改时,上一次的修改被 currentContent 的默认值所覆盖。

@hustcc
Copy link

hustcc commented Feb 16, 2022

666

@@ -0,0 +1,79 @@
/**
Copy link
Contributor

@ycjcl868 ycjcl868 Feb 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need implements.

@visiky
Copy link
Owner

visiky commented Feb 18, 2022

1、useThrottle 文件不需要了
2、react-use 需要在 dependencies 中(npm i react-use -S 即可)

@FoundTheWOUT
Copy link
Contributor Author

FoundTheWOUT commented Feb 18, 2022

react-use 的节流实现是有问题的,它在连续输入的情况下,到达阈值不会触发函数(就像是防抖一样,而不是节流,可是它 trailing 也有问题)。另外,它的 throttle 不是高阶函数,和传统的 throttle 概念不是那么相符。如果是使用库的话建议 ahooks 或者是 https://github.com/react-hookz/web

@visiky visiky merged commit 924b656 into visiky:master Feb 27, 2022
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

Successfully merging this pull request may close these issues.

4 participants