Repo to support an answer for this question on stackoverflow.
A good explanation of the code can be found in the answer.
It's a create-react-app, so for more details check that out.
To run it, do this steps:
npm install
npm run start
The app will run on port 3000
.