react is not importing redux action even though it is exported

You don’t actually pass your mapDispatchToProps to the connect HOC.

const mapDispatchToProps = dispatch => ({
  actions: bindActionCreators(
    {
      setActive
    },
    dispatch,
  ),
});


const mapStateToProps = createStructuredSelector({
  GetAccounts: getAccounts,
});

export default connect(mapStateToProps, null)(UserMenuAccounts); // passed null!!

Solution

Pass mapDispatchToProps to connect HOC.

export default connect(mapStateToProps, mapDispatchToProps)(UserMenuAccounts);

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top