mapStateToProps and mapDispatchToProps is not sending props to component

  javascript, reactjs, redux

Please I am working on a redux project but the data that was returned to mapStateToProps was not send to the component. Console.log props are undefined


LiveEvent.protoTypes = {
  event: PropTypes.object.isRequired,
  error: PropTypes.string,
};


const mapDispatchToProps = (dispatch) => { 
  return {
    getSingle: (values) => {
      console.log(Creators, "creators")
      dispatch(Creators.getOneEvent(values));
    },
  };
};

const mapStateToProps = (state) => (
  console.log(state.event.event, "state from liveEvent"),
  {
    event: state.event.event,
    error: state.event.error_message,
  }
);

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



function LiveEvent({match}, props) {
  console.log(props, "props")


Is there anything am not doing right

Source: Ask Javascript Questions

LEAVE A COMMENT