Snake Game

This is a React-based classic snake game created for fun and for practicing my React skill. Creating this small game application was a perfect way for me to improve my understanding of the fundamentals of React and have fun with this UI library.

Screenshot of Pomodoro App

Tech: React, Styled Components

Code: View Repository

Live: View Site

Project Purpose and Goal

I came across a video by Dan Abramov streaming his coding of a Snake game in plain Javascript. This is my favourite childhood game, so I decided take it as an inspiration and challenged myself to clone that game using React. It was also one of my first unguided React project after hours of online courses and tutorials.

Lessons Learned

React might be overkill for this kind of mini game application compared to the vanilla solution, but I still learned a lot throughout the process of making this game. I improved my understanding of lifecycle of a React component and how to optimize a React application. At my first try the snake didn't move as fast as the setting interval due to my bad code structuring, however after some refactoring and adding memoization the application worked as expected. Working with custom React hooks also helped me understand more about the declarative concept of React, like Dan had explained in his blog post about how to make setInterval declarative with React Hooks.