Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Passing Components as Props in React
Mohamed Amine Fh
Mohamed Amine Fh

Posted on

     

Passing Components as Props in React

Programming is a lifelong learning journey, and most of that journey is asking Questions.

And one of the Q i've asked while learningReact isHow To pass a component as Props?.

In this short Tutorial we will pass a simpleReact component (Hello) to The App component as props

Hello world Component

Pass it as a Prop

App


And This is How we use it inApp Component.

Components Must Start with an upper case letter.
That's why we rename it Here

use component as a prop

That's it Easy Peasy Lemon Squeezy 😎

So this is a Simple Exp though, but when it comes to large Apps, you will definitely need to use this.

Hope you like this Tuto

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Passionate software developer 💻
  • Location
    Tunisia
  • Education
    Self-Taught
  • Work
    Fullstack software developer
  • Joined

More fromMohamed Amine Fh

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp