5/2/2018 - 3:00 PM

React passing a components State (State vs. Stateless) components pt2

Child is going to receive a prop called name, and display that prop on the screen.

How can you make a component display a prop called name?

To access a prop, use the expression

To make a component display something, include that thing in the render function's return statement.

You need to include inside of Child's render function's return statement.

is going to pass a prop to a .

That means that a is going to render a . Rendering is the only way for a component to pass props to another component.

Any component rendered by a different component must be included in an export statement.

import React from 'react';

export class Child extends React.Component{
    return <h1>Hey, my name is {}!</h1>;