I would like to know what is the difference between useSelector and UseStore. Are there any advantages on using one instead of the other? Thanks.
useSelector
const { pages } = useSelector((state: RootState) => {
return {
pages: state.pages
};
});
console.log(pages);
useStore
const pageArrayTwo = useStore();
const pageArray = pageArrayTwo.getState().pages;
console.log(pageArray);
Same Output On Both Cases
[{…}]
0: {id: 1, title: "Use Redux", content: "Welcome"}
length: 1
__proto__: Array(0)