2021年2月6日星期六

When it is React Hooks with Redux, must it be using selectors?

In the old days, when React and Redux was used, some people use selectors, some people don't.

(I think it is "reselect" npm package, but I am not sure).

However, when React has Hooks, I think we can use

useSelector()  useDispatch()  

instead of all the mapStateToProps, mapDispatchToProps, connect(...)(Component). However, must we make use of useSelector()? Before, we have a choice to use selector or not to use it. Is it true that after we have React Hooks and Redux, then we have to use selectors?

https://stackoverflow.com/questions/66083576/when-it-is-react-hooks-with-redux-must-it-be-using-selectors February 07, 2021 at 09:03AM

没有评论:

发表评论