If you mutate the state directly it won't re-render. Instead of... [cart, setCart] = useState([1,2,3]) const updateCart = (item) => { prevCart = cart prevCart.push(item) setCart(prevCart) } Do this.... const updateCart = (item) => { let prevCart = [] cart.forEach(item => { prevCart.push(item) }); setCart(prevCart) }
### Backup mongo db container on docker host ``` docker run --rm --network [network] --link [db_container]:mongo -v /Users/sam/db_backups:/backup mongo bash -c 'mongodump -u [username] -p [password] --out /backup --host mongo:27017' ``` ### Restore mongodb database ``` docker run --rm --network [network] --link [db_container]:mongo -v /Users/sam/db_backups:/backup mongo bash -c 'mongorestore -u [mong_username] -p [mong_password] /backup --host mongo:27017' ``` The restore will wipe everything that existed before-hand.