Hackforge Academy

Category: react

parent to child props

Published on 16 Jul 2026

Explanation

Props pass data from a parent component to a child component.

Code:

<Welcome name='John' />

Explanation

Props are received as function parameters.

Code:

function Welcome(props){
 return <h1>{props.name}</h1>;
}

Explanation

Props are read-only and should not be modified.

Code:

// props.name = 'Sam'; // Not allowed

Explanation

Props can be destructured for cleaner code.

Code:

function Welcome({name}){
 return <h1>{name}</h1>;
}

Explanation

Any JavaScript value can be passed as a prop.

Code:

<User age={25} active={true} />

๐Ÿš€ Learn Spring Boot with real-world projects

๐Ÿ’ก Build REST APIs step by step

๐Ÿง  Improve backend development skills

๐ŸŽฏ Get career-ready practical training

Join Our Free WhatsApp Community

Direct access to niche-specific mentors and peers on WhatsApp.

๐Ÿ

Python Community

Discuss Django, FastAPI, AI integration, and automation scripts with 15k+ developers.

Join Python Community
โš›๏ธ

React Community

Master Next.js, Framer Motion, and State Management. Share your latest UI components.

Join React Community
โ˜•

Java Community

Deep dives into Spring Boot, Microservices architecture, and high-performance backend ops.

Join Java Community