Next, we need to use this context in our `App.js`.
We’ll see how to consume it to power our interval that grants the user cookies every second. You probably have something like this in your `Game.js`:
Copyright By PowCoder代写 加微信 powcoder
useInterval(() => {
const numOfGeneratedCookies = calculateCookiesPerTick(purchasedItems);
setNumCookies(numCookies + numOfGeneratedCookies);
We’ll import the GameContext, pluck out the relevant data, and update the interval. Give this a shot first!
> 🆘 **If you are stuck, or want to compare, you can look at this [hint](./_hints/hint-2.md).**
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com