Files

28 lines
418 B
Markdown
Raw Normal View History

2018-10-12 15:37:13 -04:00
---
title: Map Dispatch to Props
---
## Map Dispatch to Props
### Solution
<details>
<summary>Spoiler!</summary>
```jsx
const addMessage = (message) => {
return {
type: 'ADD',
message: message
}
};
2018-10-12 15:37:13 -04:00
// change code below this line
const mapDispatchToProps = (dispatch) => {
return {
submitNewMessage: (message)=>{
dispatch(addMessage(message))
}
}
}
```
</details>