Answer the question
In order to leave comments, you need to log in
How did dispatch end up in props?
Hello everyone!)
Please tell me how here https://redux.js.org/advanced/exampleredditapi#con... the dispatch() function was available via this.props.dispatch()? I suppose in mapStateToProps somehow implicitly ..
Answer the question
In order to leave comments, you need to log in
Because in this example, mapDispatchToProps() is not passed to connect(), and by default its value is dispatch => ({ dispatch })
You can read more in off. doc https://react-redux.js.org/docs/api#arguments or here https://stackoverflow.com/questions/34458261/how-t...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question