Files
2019-05-09 18:57:06 +05:30

28 lines
418 B
Markdown

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