Using ReactJS on itch.io
Despite clearly not being a game engine, ReactJS has a lot of potential for being used to create simple HTML based games - in fact, one of the first use cases React introduces to you in its tutorials is using the React framework to create Tic Tac Toe.
So say you want to build a game in ReactJS and upload it to itch.io. If you started your project by running
npx create-react-app, then ran
npm run build, zipped up the folder, then uploaded it to itch.io, you
will see a result of something like this:
So how do you fix this? The solution is, thankfully, quite simple. Go into your
package.json and add the following line after the
Then simply rebuild the project, upload it, and the results should be as follows:
Hopefully this has helped you if this was a problem you encountered.
ReactJS is certainly far from being a common framework used for online games, but there are a fair few examples of great React games to be found on itch.io. Here are a few I liked:
- hacker-forest - great puzzle game with simulacra of hacking into a website.
- Turkey Hunt - classic arcade hunting game.
- doop - really well polished puzzle game about rotating layers.
- Happy Mice - curious little simulator of mice life and death.
- Minesweeper Clone - very clean minesweeper clone.
- Valyrian Wordle - a Wordle clone, but in High Valyrian, a language of Game of Thrones.