Skip to content

Instantly share code, notes, and snippets.

@itaditya
Created September 28, 2020 04:43
Show Gist options
  • Save itaditya/f3f6f18185611d937137b3e84ed6df92 to your computer and use it in GitHub Desktop.
Save itaditya/f3f6f18185611d937137b3e84ed6df92 to your computer and use it in GitHub Desktop.
(Blog) Build a Redux hooked app
import { shallowEqual, useSelector } from 'react-redux';
export default function App() {
const diet = useSelector((state) => state.diet);
const menuList = useSelector(selectorMenu, shallowEqual);
useEffect(() => {
console.log('SERVER_EVENT: menu list changed');
}, [menuList]);
return (
<div className="food-app">
// rest of the code
<MenuList menuList={menuList} />
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment