React Basics: Components and the Importance of State
So you’re learning React and come across components. Class components, functional components, and wait, hooks? Read on to understand the difference between them (🤫 the secret is state)
Published in
8 min readFeb 17, 2021
Table of Contents
- Introduction
- Background Info
2a. So… What are Components?
2b. Bonus! Arguments vs Parameters
2c. So… What is State? - Class Components vs Functional Components
3a. Bonus! constructor() - Hooks
4a. Bonus! useState() - Conclusion & Takeaways
- Want more? Other resources to check out!
Introduction 🐣
We all start from somewhere, and one of the things I enjoy most about coding is that we’re often beginners. When learning something new I often start with the vocabulary so that I have a strong foundation for the new concepts. That said, after you get the hang of things sometimes it’s the basics that are the hardest to explain. For newbies to React and for those of us who need a refresher, read on! 🚀