Tencent / Tencent/tdesign-react
[Comment] actions prop 设计不太合理
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 965
- Forks
- 373
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 17
Description
tdesign-react 版本
1.1.8
重现链接
https://tdesign.tencent.com/react/components/comment?tab=demo
重现步骤
actions prop 类型接收一个 Array<TNode>,但是在渲染的时候会在最外层用 button 包裹
业务中通常有权限校验以及状态变化(点赞高亮、禁用状态等),这些没法作用在 button 容器上
另外,现在的逻辑看起来 onClick 只能写在里面的元素,好像也不太合理
为啥 actions 不是开放成一个插槽呢,是担心基本 UI 被破坏吗?
期望结果
No response
实际结果
No response
框架版本
No response
浏览器版本
No response
系统版本
No response
Node版本
No response
补充说明
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Comment component demo at the linked TDesign React URL and trace how the actions prop is typed and rendered. Clarify whether actions should be a slot or retain the current API, including permission checks, active and disabled states, and click handling; done requires an agreed behavior and corresponding coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100