I am not sure if this is even possible but I have a table that has an onClick event on each row that directs the user to another page. I need to add a button inside each row to handle a separate event. But everytime I click the button the action to redirect to a new page is fired. Is it possible to have a click event inside another?
example:
items.map((item) => {
return(
<tr onClick={onClick(item.value)}>
<td>{item.Name}</td>
<td>
{visitCreated}
<span>
<button
type="button"
onClick={handlePreview(item.referenceID)}>
Preview
</button>
</span>
</td>
<td>{item.Encounters}</td>
</tr>
})
Anytime I click the both events are triggered. How can I isolate them?