Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
修复上次pr中此hook存在的bug
在开发中经常遇到这样的需求:受控组件要防抖地进行更新.这个hook可以解决这个问题.
InputWithMutation可以在受控的同时接受一个经过防抖处理的onChange作为参数
现在可以在输入框内自由输入 同时在text突变的时候控制输入框内的值
相比useControllableValue,这个钩子允许组件在受控/非受控间自由切换而不需要对value做特殊处理,也可以用于防抖、transition等异步更新情形 参考https://codesandbox.io/p/devbox/test-usevaluemutation-nfcnk3
📝 Changelog
☑️ Self Check before Merge