Counter App

React Practice

This was a simple counter app. I thought it would make sense to start with something where the browser was not reloading with every user input, showing the React most important use case in my opinion. And the simplest project felt like a counter app.

All the code is right there in the `App.js` and the styling in the `App.css` files.

The code can be refactored to have a single `handleClick` function. I tried, but I have totally forgotten `this`. And this late in the night, I just wanted to finish the work. I'll probably refactor the code some days later when I have brushed up on some JS concepts.

I'll do more studies tomorrow and move on to a newer app.

Deployment

For this project, I got to understand how monorepos are deployed on Netlify. Studied a bit about monorepos, realized their structure, limitations and such.

Update

I restarted work on React practice and have recreated the counter app. Learnings: - Use TypeScript. I was missing calling the `handleClick` on one of the buttons. The `jsx` file kept throwing errors in my face. The `tsx` file showed me the error in the function call. I used a `useState` hook here and passed a single `handleClick` function.


Deployment

Design