onclick is not working if i pass other then button html element on renderItem hook #114
Answered
by
lukasbach
iamravisingh
asked this question in
Q&A
-
I am trying to add a custom treeItem but having issues while expanding. click is not working if I try to add that on other than the button element. Can you help me with what I am missing here, any help is appreciated.
|
Beta Was this translation helpful? Give feedback.
Answered by
lukasbach
Jul 29, 2022
Replies: 1 comment 2 replies
-
Hi @iamravisingh. Yes, <Text
{/* ... remaining props */}
{...context.itemContainerWithoutChildrenProps}
{...context.interactiveElementProps}
onClick={e => {
callback(e);
context.interactiveElementProps(e);
}}
> |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
iamravisingh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @iamravisingh. Yes,
interactiveElementProps
is defining it's ownonClick
handler and is overwriting your own onclick callback. Try something like this