When creating a React app, if I use the hook useSelector
, I need to adhere to the hooks invoking rules (Only call it from the top level of a functional component). If I use the mapStateToProps
, I get the state in the props and I can use it anywhere without any issues... Same issue for useDispatch
What are the benefits of using the hook besides saving lines of code compared to mapStateToProps
?