React - Nested Components Tutorial (Childen props)

Pubblicato il: 18 ottobre 2023
sul canale di: Austin Davis
8,065
191

If you look at React projects, you may often see React components inside other React components. This is something I call 'component nesting' which has interesting applications in React.

To nest React components, you have to use the reserved prop named children. The React children prop allows us to have parent components with an opening and closing tag, and allows us to put children component in between those two tags.

Normally to specify props you need to write propName={something} when rendering a component, but children doesn't use this same method. Instead, any component or JSX you put in between the opening and closing tags will be stored as props.children.

Watch the video for a full explanation!

If this helped you out, please consider subscribing to my channel and liking the video, as it helps out my engagement and growth tremendously! :)

Hashtags:
#reactjs #reacttutorial #reactjsdeveloper


In questa pagina del sito puoi guardare il video online React - Nested Components Tutorial (Childen props) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Austin Davis 18 ottobre 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 8,065 volte e gli è piaciuto 191 spettatori. Buona visione!