React has become one of the most popular JavaScript libraries for building modern, interactive user interfaces — especially single-page applications (SPAs). Developed by Facebook, React makes it easier to manage complex UI logic through reusable components, efficient rendering, and a clean programming model. In this blog, we’ll explore the three core building blocks of React: Components, JSX, and Props.
What Is React?
React is a component-based library used to build dynamic web interfaces. Instead of manipulating the DOM directly, React uses a virtual DOM to efficiently update only the parts of a webpage that change. This results in better performance and a more maintainable codebase.
Understanding Components
Components are the heart of React. They are reusable, independent pieces of UI that can be combined to create complex applications. Think of them as custom HTML elements that encapsulate structure, styling, and logic.
There are two main types of components:
- Functional Components – These are simple JavaScript functions that return JSX.
function Welcome() { return <h1>Hello, React!</h1>; } - Class Components – Older React code often uses ES6 classes to define components. They include lifecycle methods and manage state internally.
class Welcome extends React.Component { render() { return <h1>Hello, React!</h1>; } }
Most modern React code uses functional components with hooks (like useState and useEffect) for managing state and side effects.
What Is JSX?
JSX (JavaScript XML) is a syntax extension for JavaScript that looks similar to HTML. It allows developers to write UI elements directly in JavaScript code, making it easy to visualize component structure.
Example:
const element = <h1>Welcome to React!</h1>;
Under the hood, JSX is compiled to JavaScript using tools like Babel:
const element = React.createElement('h1', null, 'Welcome to React!');
Why use JSX?
- It makes code more readable and expressive.
- It allows embedding JavaScript expressions using
{}. - It helps catch errors early through compilation.
Understanding Props
Props (short for “properties”) are how data is passed from one component to another — usually from a parent to a child. Props make components dynamic and reusable by allowing them to display different content based on the data received.
Example:
function Greeting(props) {
return <h2>Hello, {props.name}!</h2>;
}
// Usage
<Greeting name="Parmeet" />
In this example, the Greeting component receives the name prop and displays it dynamically. Props are read-only, meaning a component cannot modify the props it receives — this ensures predictable, one-way data flow.
Bringing It All Together
Let’s combine what we’ve learned with a simple React example:
function UserCard(props) {
return (
<div className="card">
<h3>{props.name}</h3>
<p>{props.role}</p>
</div>
);
}
function App() {
return (
<div>
<UserCard name="Alex" role="Frontend Developer" />
<UserCard name="Sam" role="UI Designer" />
</div>
);
}
Here:
- Each
UserCardis a component. - JSX defines the UI.
- Props (
nameandrole) customize each card.
Final Thoughts
React’s component-based architecture, JSX syntax, and prop system together make it one of the most powerful tools for building scalable UIs. Whether you’re developing a simple portfolio site or a complex dashboard, mastering these fundamentals is the first step toward becoming proficient in React.
In upcoming posts, we’ll dive deeper into State, Hooks, and Component Lifecycle — the next layers of React mastery.
Ready to start building with React?
Install Node.js, set up your first React app using Create React App, and start experimenting with components today!









