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: 修复useInViewport的rootMargin值无法使用组件state更新 #1984
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fix rootMargin does not update when using setState
commit 的信息尽量语义化一点~ |
修复useInViewport的rootMargin值无法使用组件state更新
好的好的 |
useInViewport的rootMargin值无法使用组件state更新
captain1023
changed the title
fix: rootMargin
fix: 修复useInViewport的rootMargin值无法使用组件state更新
Nov 28, 2022
li-jia-nan
approved these changes
Nov 29, 2022
threshold 是不是也可以作为依赖项监听一下? |
添加threshold监听
我觉得大佬说的对😂 |
test 补一下吧 ~ |
umm 因为这个要用react setState去设置margin,去改变rootMargin验证效果. 所以Test怎么写目前没什么思路. 可以麻烦大佬们提供个思路或者类似的test案例吗 🙏🙏🙏 |
crazylxr
approved these changes
Dec 19, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fix rootMargin does not update when using setState
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
☑️ Self Check before Merge