I'm struggling a bit accessing some redux functions from Navigation.js. I want to be able to call a redux function when I press a tab on a tabBar. To do this, I am calling
Navigation.js:
tabBarOnPress: () => {
console.warn("I am here")
store.dispatch({ type: nameOfMyReduxFunction, })}
I correspondingly have, in a separate reducer / redux file:
export const nameOfMyReduxFunction = () => {
console.warn("nameOfMyReduxFunction being called")
return dispatch => {
dispatch({ type: "NAME_OF_MY_REDUX_FUNCTION" });
};
};
When I run the app, I get "I am here". However, the redux function appears to never run, as "nameOfMyReduxFunction being called" is never printed. Could anyone give me some tips on why this is?