J
J
jikrosmikers2020-04-15 14:35:04
React
jikrosmikers, 2020-04-15 14:35:04

What is the equivalent of mapStateToProps and matchDispatchToProps in Redux when in a React application before adding a Redux functional component and useState hook?

I have a React application and in the file my component is functional and I use the useState hook there. But you need to add Redux to the application. I heard that in Redux for such cases (when there is no class component and there are hooks) there are methods analogous to mapStateToProps and matchDispatchToProps, but I don’t remember their names. What are their names?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ivan0512, 2020-04-15
@jikrosmikers

You need to use the hooks provided by react-redux: useSelector, useDispatch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question