Latest solutions
Memory Game with React and Typescript
#material-ui#react#styled-components#typescript#vitePSubmitted 5 months ago
Latest comments
- @mateusbelicioP@UreaLaden
Dude this is clean, really good job. My only suggestion would be to consider using react context (https://reactjs.org/docs/context.html#contextprovider) instead of passing props and storing data in local storage. The context API is meant for sharing state throughout the component tree without have to pass props down manually at every level. Local storage lets you save data across the browser session, however you can't notify your other components on a state change making it difficult to scale. (https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage)
Marked as helpful - @CodingTimmyethP@UreaLaden
Overall I think your solutions pretty good for a start and it is fairly easy to understand. The biggest issue is that this solution is not reusable. You're hardcoding a lot of strings and values so this can't be used in any other context. There's quite a bit of repeat code which should tell you that you may need to include some functions or do some refactoring. Your repo contains the data.json but you copied your own. Why not just read from the json file and use that instead? I love your use of css variables. One last note and this is something i'm constantly struggling with. All of your positioning and sizing may be pixel perfect but you'll want to start considering different viewport sizes. While it may look decent on your screen, it'll probably look strange on another. Great job!
Marked as helpful