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));
        }

    };
}
Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct