## Guessing Game ๐ŸŽฎ (Ji(Jihye) and Mohamed) --- <iframe src="https://giphy.com/embed/xUPGGDNsLvqsBOhuU0" width="480" height="360" frameBorder="0" class="giphy-embed" allowFullScreen></iframe> ## [Demo](https://reverent-varahamihira-23e4de.netlify.app/) ๐Ÿ“ฝ --- ## Plan (Jihye) ### App structure ![](https://i.imgur.com/1mBiCwM.png) --- ### Project board ![](https://i.imgur.com/wWBeBfB.png) --- ### Style ![](https://i.imgur.com/YvuRmRG.png) --- ## bugs๐Ÿ›๐Ÿž (Jihye) <iframe src="https://giphy.com/embed/l46CwEYnbFtFfjZNS" width="480" height="472" frameBorder="0" class="giphy-embed" allowFullScreen></iframe> --- ### Small mistakes eat time! ![](https://i.imgur.com/RkH96Rc.png =550x) ๐Ÿ™…โ€โ™€๏ธ ```return {}``` ๐Ÿ™…โ€โ™€๏ธ ๐Ÿ™†โ€โ™€๏ธ ```return ()``` ๐Ÿ™†โ€โ™€๏ธ We spent a long time to figure out when our components didn't return anything. It was because we used {} after return with React we should use () to return. --- ### Still working on it ``` function checkFollower(val) { return followersList.includes(val); } if (checkFollower(value)) { setScore(score + 10); return ( <div className="flex-row"> <p>Points</p> <div className="round">{score}</div> </div> ); } else { return ( <div className="flex-row"> <p>Points</p> <div className="round">{score}</div> </div> ); } ``` --- ### File structure matters ![](https://i.imgur.com/hpPQRMX.png =150x)![](https://i.imgur.com/GIvvCfm.png =150x) When we depoloyed our app on Netlify, it didn't render our components properly. I could be we didn't have out package.josn on the top level or we had a nested directory. After relocating everything we were able to deploy out app ๐Ÿฅณ --- ``` "scripts": { "dev": "vite", "build": "vite build", "serve": "vite preview" }, ``` --- ### Running effects ``` React.useEffect(() => { fetch(url + props.name) .then((res) => res.json()) .then((data) => setUserName(data)); }, []); ``` When we used reactEffect() to update state, we put an empty array as a second argument or put some values inside of the array. It caused a lot of problems (e.g exceeding API limit, state is not being updated). We now know when to use empty/non empty array or just leave it empty --- ### Learnings - [ ] useEffect - [ ] Getting kicked๐Ÿฆต out Github API ![](https://i.imgur.com/roMGVv3.png) - [ ] learning new syntax - [ ] Netlify deployment - [ ] false sense of confidence ๐Ÿคซ --- ## Future Improvements <iframe src="https://giphy.com/embed/13FrpeVH09Zrb2" width="480" height="262" frameBorder="0" class="giphy-embed" allowFullScreen></iframe> - [ ] css - [ ] Time limits removing you from the gameโฐ - [ ] maintaining user sessions. - [ ] more instructions about the inputs (aria-label) --- ## Future Improvements <iframe src="https://giphy.com/embed/3o6MbokumzM4Vo8QRW" width="280" height="366" frameBorder="0" class="giphy-embed" allowFullScreen></iframe><p> - [ ] scoring board ๐Ÿ“ - [ ] scoring counter --- ## Any Questions <iframe src="https://giphy.com/embed/lCN6LF3S1fQWc" width="417" height="480" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>
{"metaMigratedAt":"2023-06-16T13:26:10.464Z","metaMigratedFrom":"YAML","title":"Guessing Game (Ji(Jihye) and Mohamed)","breaks":true,"description":"View the slide with \"Slide Mode\".","contributors":"[{\"id\":\"1ae0974c-1a1b-4ae5-acee-c1dc5af8fc80\",\"add\":2028,\"del\":94},{\"id\":\"0a3ab15b-3310-4524-96d0-8240b9d0005e\",\"add\":1758,\"del\":379}]"}
    165 views
   Owned this note