The example code for the problem of the conditional Hook of our simple Hook reimplementation can be found in the Chapter02/chapter2_2 folder.
Just run npm install in order to install all dependencies and npm start to start the application, and then visit http://localhost:3000 in your browser (if it did not open automatically).