Skip to content

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Sep 18, 2023

更标准的解法应该是 useState 在关闭时一起做 state 更新,但是这样会让渲染逻辑变得过于复杂。只为了少一次渲染会变得缺少性价比。

close ant-design/ant-design#44890

@vercel
Copy link

vercel bot commented Sep 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
table ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2023 7:22am

@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Merging #1022 (3925977) into master (f6e1871) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 3925977 differs from pull request most recent head e4e2e40. Consider uploading reports for the commit e4e2e40 to get more accurate results

@@            Coverage Diff             @@
##           master    #1022      +/-   ##
==========================================
- Coverage   99.41%   99.41%   -0.01%     
==========================================
  Files          47       47              
  Lines        4430     4426       -4     
  Branches      561      559       -2     
==========================================
- Hits         4404     4400       -4     
  Misses         26       26              
Files Changed Coverage Δ
src/Body/BodyRow.tsx 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

const [expandRended, setExpandRended] = React.useState(false);
// Force render expand row if expanded before
const expandedRef = React.useRef(false);
expandedRef.current ||= expanded;
Copy link
Member

Choose a reason for hiding this comment

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

新语法? 我赶紧百度学习一下.

Copy link
Member Author

Choose a reason for hiding this comment

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

||= 不是新语法,就是用的比较少~~

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.

Table expandedRowRender 会渲染多次
2 participants