How to Stop Click Event Bubbling With e.stopPropagation() in React

Solution 1:

here is the culprit:

<button onClick={(e) => e.stopPropagation(), handleClick}>

try:

<button onClick={(e) => { e.stopPropagation(); handleClick(); }>

live demo on these two different versions: https://codepen.io/remyho427/pen/NWamxvG