What I Learned in React Today: Components, JSX, Props, and More!

What I Learned in React Today: Components, JSX, Props, and More!

Today was a productive day in my React learning journey! 🚀 I dove into some really important fundamentals that form the backbone of every React application. Here’s a quick summary of what I learned:

It’s All About Components!

React apps are made up of components — reusable, independent pieces of UI. Everything in React revolves around building and combining components.

Setting Up the Project

I learned how to set up a basic React project, structure the folders properly, and prepare a development environment that makes building easier.

JSX & React Components

JSX lets us write HTML-like code inside JavaScript. It’s not just syntactic sugar — it helps us describe what the UI should look like, and React takes care of rendering it efficiently.

Creating & Using Custom Components

I created my first custom component! It’s like making a mini UI block that you can reuse anywhere. I also explored how file extensions like .js and .jsx matter in React projects.

Component Tree & How React Builds It

React builds something called a “component tree” under the hood — a hierarchy of how all components are related. Understanding this helps debug and structure apps better.

Dynamic Content & Props

Components become powerful when they can accept dynamic values — that’s where props come in! Props let you pass data from one component to another and render dynamic content.

Reusable Components

Instead of hardcoding values, I learned to make components flexible using different prop syntaxes and even props.children to compose components together. This helps in writing clean, maintainable code.

Styling Components

I explored best practices like storing style files next to components and learned how to apply CSS dynamically based on props or state.

Handling Events

React allows event handling just like HTML, but with some added power — like passing custom arguments and keeping logic inside JavaScript functions. I also learned some dos and don’ts of UI updates.

Managing State with Hooks

State is what makes a component interactive. With the useState hook, I was able to make my components remember and react to user input or events.

Derived & Conditional Content

Sometimes, you don’t store everything in state. You derive values based on the current state and conditionally render parts of the UI — a super handy pattern for real apps!

Dynamic Lists

Finally, I learned how to render lists dynamically by mapping over arrays. Combining that with conditional rendering makes the UI feel alive and interactive.

Wrapping Up

Today’s focus was on React’s core building blocks â€” components, JSX, props, state, and events. These may sound basic, but they’re the foundation of every React app.

I’m really enjoying the process so far. If you’re also learning React, let’s connect!

Leave a Comment

Your email address will not be published. Required fields are marked *