Learn
Components Render Other Components
Apply a Component in a Render Function

This is new territory! You’ve never seen a component rendered by another component before.

You have seen a component rendered before, though, but not by another component. Instead, you’ve seen a component rendered by ReactDOM.render().

When a component renders another component, what happens is very similar to what happens when ReactDOM.render() renders a component.

Instructions

1.

You can see two files in the code editor: ProfilePage.js and NavBar.js.

In this lesson, you are going to make a <ProfilePage /> render a <NavBar />.

How do you do that? To start, simply make ProfilePage‘s render() method return a <NavBar /> instance.

In ProfilePage.js, place a <NavBar /> on line 9.

Folder Icon

Take this course for free

Already have an account?