Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mapdispatchtoprops

render() {
  return <button onClick={() => this.props.toggleTodo(this.props.todoId)} />
}

const mapDispatchToProps = dispatch => {
  return {
    toggleTodo: todoId => dispatch(toggleTodo(todoId))
  }
}
Source by react-redux.js.org #
 
PREVIOUS NEXT
Tagged: #mapdispatchtoprops
ADD COMMENT
Topic
Name
6+6 =