Let’s start by building a static version of our user interface. So I wrote some hints about how you can improve it if you wish to do so.īut first thing first, we need to lay the game’s foundations. The game will be operational at the end of the tutorial, but far from being polished. How to debug your app from state reference issues that are common in javascript applications.The difference between local state and global state, and how to implement it with the same State Hook.Make individual components stateful instead of stateless, so our app can respond to click events.
Here’s a peek at what we will discuss here: There is a bunch of different hooks to use for various goals, but we will focus on the most basic one: the State Hook. They come with the React library by default so if you start a new React project, you won’t have anything special to install. React Hooks are a fairly recent addition to the React framework that came out with React 16.8. In this tutorial we will see how to make these components ‘react’ to the user actions by using the State Hook. React offers a simple and efficient way to structure our application through function components.