Sign in
Log inSign up

Which method are you using for map Redux dispatches to props?

Mark Rosenthalstein's photo
Mark Rosenthalstein
·Nov 12, 2016

Found this question somewhere on web and happens to be my question as well. Which method do you use and why?

function mapDispatchToProps(dispatch){
    return {
        onDeleteFlashMessage : bindActionCreators(deleteFlashMessage, dispatch),

        <!--  OR THIS -->

        onDeleteFlashMessage : (id) => {
            dispatch(deleteFlashMessage(id));
        }

    };
}