Table onRow Event multiple triggered
See original GitHub issueVersion
3.1.0
Environment
macos 10.12.6, chrome 63
Reproduction link
Steps to reproduce
My component which using Table component in 2.x versions, when I migrate to 3.x versions, console print out such errorwebpack-internal:///15:49 Warning: onRowClick is deprecated, please use onRow instead.
, when I replace onRowClick with onRow event, my Component BREAK DOWN, as I use setState
with onRowClick[onRow]
What is expected?
event should be triggered when I click table item
What is actually happening?
it triggered when each line rendered
when I look into source code in Table component, https://github.com/ant-design/ant-design/blob/1eff817b9ada2169f0ddeb5e2e9fd2df88270134/components/table/Table.tsx#L218, why you execute props onRow event, cuz used in onRowClick is bind event, or maybe you have changed the usage purpose of this function
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:24 (4 by maintainers)
Top Results From Across the Web
Table onRow Event Triggered Multiple - CodePen
URL Extension Required. When linking another Pen as a resource, make sure you use a URL Extension of the type of code you...
Read more >Reactjs: Antd Table onRowClick trigger all event
So i'm new to reactjs, im doing a table that when you click on 1 row it will render a detail description for...
Read more >'select' and 'deselect' events triggering multiple times on row ...
I've read into using the table.rows( { selected: true } ).data(); function to get this data as well, but I would rather only...
Read more >How to use Bots - Tables Help Center
1. Bot triggers. The bot trigger defines a particular event or time to "run" the bot and have it check its conditions and...
Read more >CREATE TRIGGER statement - Oracle Help Center
For example, if you define a trigger for a delete on a particular table, the trigger's ... including multiple triggers on the same...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Perfect!!!
It works with:
Thanks a lot @yesmeck !!!
@TimKraemer ,as @dengfuping said, the
onRow
event is to set props for each row, it means the work ofonRow
is changed, and you need to passrowSelection
[Object] props to deal with select events. You can checkout my modified codepen,OR check the document this part: https://ant.design/components/table/#rowSelection. Hope this helps. Also I think they should change the warning description as this props function totally changed, not instead.