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)

Waverley Leung
The Startup

--

Photo by Stefan Steinbauer on Unsplash

Table of Contents

  1. Introduction
  2. Background Info
    2a. So… What are Components?
    2b. Bonus! Arguments vs Parameters
    2c. So… What is State?
  3. Class Components vs Functional Components
    3a. Bonus! constructor()
  4. Hooks
    4a. Bonus! useState()
  5. Conclusion & Takeaways
  6. 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! 🚀

Background Info 🖼️

--

--

Waverley Leung
The Startup

“Be present. Be open. Be kind. But speak your mind.” 🌱 Passionate about tech, connecting with people, eating good food, and dancing to my heart’s content.