- Fork the repository
- Clone it.
cd
into the project directory.- Install the required packages for the task.
$ yarn install
5. Run the project
$ yarn start
Everything is being rendered in App.js
right now. This makes it hard to manage the application.
In this task, you're going to separate the UI into independent components:
Move the sidebar
JSX from App.js
into a separate component:
- Create a new component file in the
src
directory calledSidebar.js
- At the top of your file,
import React from 'react'
- Create a new component function called
Sidebar
(don't forget to export it at the bottom of your file). - Move the relevant JSX from
App.js
into the new component. - Import and use the new component in
App.js
.
- Turn the grid of authors into its own
AuthorList
component. Import it and use it inApp.js
. - You're going to have a lot of
'authors' is not defined
errors in your console! - Fix your app by passing the
authors
array fromApp.js
into your new component as a prop.
- Make a new component for an individual author card.
- Import it and use it in your author list component.
- Make sure each card is displaying data for a different author.
- Use a
.map
to dynamically create the author cards. Don't forget to give each card akey
attribute.
- Push your code.