Learn about React HOOKS by creating a Counter App (with a twist)!
HTML-код
- Опубликовано: 10 сен 2024
- Lots of video tutorials out there still teach using class-based components. In this tutorial, we will be creating a counter app by using hooks: specifically the useState hook and the useEffect hook. We will also deep dive into some of the nuances of using useEffect.
If you are getting started on React, but still want to learn more about hooks, then this video is for you!
🗄 Resources:
Github Repo: github.com/ang...
Download Node.js: nodejs.org
🔑 Key Concepts:
- React
- Hooks
- useState
- useEffect
#React #Hooks #useState #useEffect #Counter
hey guys, check out the finished code here! github.com/angle943/counter-app-hooks
justin you are great. please keep teaching.
Thank you Justin, glad I found your channel!
Great tutorial Justin,
I have a question though, to resolve the NaN issue, isn't better to just give the input a type of number ?
Please let me know your thoughts, I'm a beginner and just trying to understand if this idea would work or if not, why not.
Thank you
Absolutely excellent demo hooks instructional application and video. As you did with the tic tac toe, I'd go and add TypeScript type definitions to it to make this a professional looking app, at the same time I'd make it a PWA, thereafter, deploy it on Azure, Google, Heroku, wherever, to get a free HTTPS source, which is essential for PWAs, then I'd show how to deploy on mobile phones. That would be an excellent series. Just an idea to make this simple example shine in the context of a full development workflow.
thank youuuuuuu
Is it ok to start learning hooks without being good at React class?
김경현 Frank Yes! The official react team endorses using functional components over class based components. In my opinion, the only benefit to learn class-based components these days is only to be able to work with legacy code. So yes I highly encourage getting good with hooks, and later when you have time you can check out class based componwnts