Answer the question
In order to leave comments, you need to log in
How to get data from store in mapDispatchToProps?
There is this code:
class App extends React.Component {
render() {
return(
<div>
</div>
)
}
}
function mapStateToProps(state) {
return {
fruit: state.fruit,
}
}
function mapDispatchToProps(dispatch) {
return {
onAddPhotos: () => {
alert() //тут нужно взять данные из стора
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(App);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question