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: 解决ProTable.editable.actionRender无法获取最新state快照的问题(第二种改法) #8549

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

ShuangxingYang
Copy link
Contributor

#8547的另外一种改法

Copy link

github-actions bot commented Jul 8, 2024

⚡️ Deploying PR Preview...

@chenshuai2144
Copy link
Contributor

感觉还是这个好一点,少渲染一点是一点

@@ -1027,6 +1027,13 @@
},
);

// 如果传入了自定义的actionRender,使用useRefFunction以确保内部的事件处理函数可以访问最新的state
const existCustomActionRender = props.actionRender && typeof props.actionRender === 'function'

Check notice

Code scanning / CodeQL

Semicolon insertion Note

Avoid automated semicolon insertion (93% of all statements in
the enclosing function
have an explicit semicolon).
const customActionRender = existCustomActionRender
? props.actionRender
: () => {};
const customActionRenderRef = useRefFunction((customActionRender as ActionRenderFunction<RecordType>))

Check notice

Code scanning / CodeQL

Semicolon insertion Note

Avoid automated semicolon insertion (93% of all statements in
the enclosing function
have an explicit semicolon).
@chenshuai2144
Copy link
Contributor

我感觉这个简单一点, memo以后加多了更加复杂

@chenshuai2144 chenshuai2144 merged commit 8d9fa00 into ant-design:master Jul 12, 2024
7 of 10 checks passed
@ShuangxingYang
Copy link
Contributor Author

是的,写方法一的时候还没看到defaultDOM是怎么做的,看完了觉得defaultDOM的实现更好点 就参考了下哈哈😈

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.

2 participants