the following code works perfectly:
const onMenuItemClick = (item) => {
return {
type: "MENU_ITEM_CLICKED"
}
this code dispatches the action twice:
const onMenuItemClick = (item) => {
document.getElementById("menu-button").click();
return {
type: "MENU_ITEM_CLICKED"
}
my question is, why does this click makes the action dispatches twice?