Skip to content
Discussion options

You must be logged in to vote

Replace onClick: row.toggleExpanded by onClick: () => row.toggleExpanded()

onClick implicitly send React.MouseEventHandler<HTMLButtonElement> as a parameter, so the way you do it is the equivalent of onClick: (event: React.MouseEventHandler<HTMLButtonElement>) => row.toggleExpanded(event) where event will always be true, which make the row openable but not closable.

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
5 replies
@Gusis93
Comment options

@AzzouQ
Comment options

@Gusis93
Comment options

@AzzouQ
Comment options

@Gusis93
Comment options

Answer selected by Gusis93
Comment options

You must be logged in to vote
2 replies
@Gusis93
Comment options

@clarkkamorr24
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants