DIVYA PANDRAJU’s Post

⚛️ A small React “props” moment I’ll never forget! I was building a simple Profile component that needed to display a user’s name and role. I passed the props from the parent and expected it to just work — but nothing appeared on the screen. 😅 After checking my code multiple times, I realized I had forgotten the most important part — actually using the props inside the component! ❌ Wrong: function Profile() { return <h2>{name}</h2>; } ✅ Correct: function Profile(props) { return <h2>{props.name}</h2>; } That’s when it clicked — props are like packages 📦 that the parent sends to the child. If you don’t open (use) them properly, the child has no idea what’s inside! 💡 Lesson learned: Props make React components reusable and dynamic — but only if you remember to “unwrap” them first. 😉 Every tiny bug in React is a small reminder to pay attention to the details — because that’s where the learning happens. 🚀 #ReactJS #WebDevelopment #FrontendDeveloper #MERNStack #Props #CodingJourney #LearningByDoing

To view or add a comment, sign in

Explore content categories