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

修复SwipeAction按钮点击事件里setState后子组件无法点击的问题 #6336

Closed
wants to merge 1 commit into from

Conversation

caocong1
Copy link

详情见这个issue
#6184

Copy link
Author

@caocong1 caocong1 left a comment

Choose a reason for hiding this comment

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

添加React.useMemo做缓存,使setState引起的重渲染不影响animated动画。

@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (8a3f426) 91.56% compared to head (0b1fd98) 91.56%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6336   +/-   ##
=======================================
  Coverage   91.56%   91.56%           
=======================================
  Files         306      306           
  Lines        6592     6593    +1     
  Branches     1627     1627           
=======================================
+ Hits         6036     6037    +1     
  Misses        521      521           
  Partials       35       35           
Files Changed Coverage Δ
src/components/swipe-action/swipe-action.tsx 97.14% <100.00%> (+0.02%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link
Contributor

PR preview has been successfully built and deployed to https://antd-mobile-preview-pr-6336.surge.sh

>
{props.children}
</animated.div>
{React.useMemo(
Copy link
Member

Choose a reason for hiding this comment

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

这个有点怪异,理论上来说不应该用 memo 来做节点控制。因为在 Suspense 里这个 memo 是不保证的。

@1587315093 1587315093 closed this Dec 14, 2023
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.

3 participants