2

So, what I want to achieve is that the wrapping link I have to be clickable on all places, instead when the button is clicked don't call the function or click the item

<a href="test.com">
 <img />
 <title />
 <button>
  Add to Cart
 </button>
</a>
nevoni3008
  • 227
  • 1
  • 11

1 Answers1

1

First of all, mixing a link and a button isn't a good idea Can I nest a <button> element inside an <a> using HTML5?

Second of all use event.preventDefault()

Konrad
  • 21,590
  • 4
  • 28
  • 64
  • question here https://stackoverflow.com/questions/75838680/react-parent-clickable-box-has-child-clickable-button – mattsmith5 Mar 24 '23 at 22:55