Answer the question
In order to leave comments, you need to log in
Multiple useSelectors or one shared one?
Hey!
The router has its own separate reducer and actions. In App.js, you need to get data from routerReducer.js, namely: page, url, metas, etc.
Actually, what is the best way to do this: use several useSelectors or one common one?
const router = useSelector((state) => state.router);
// или
const page = useSelector((state) => state.router.page);
const url = useSelector((state) => state.router.url);
const metas = useSelector((state) => state.router.metas);
Answer the question
In order to leave comments, you need to log in
const { page, url, metas } = useSelector((state) => state.router);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question