Skip to content

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
Discussion options

You must be logged in to vote

Hi @iamravisingh. Yes, interactiveElementProps is defining it's own onClick handler and is overwriting your own onclick callback. Try something like this

      <Text
        {/* ... remaining props */}
        {...context.itemContainerWithoutChildrenProps}
        {...context.interactiveElementProps}
        onClick={e => {
          callback(e);
          context.interactiveElementProps(e);
        }}
      >

Replies: 1 comment 2 replies

Comment options

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

@iamravisingh
Comment options

Answer selected by iamravisingh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants