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?
没有评论:
发表评论