Last active
August 11, 2018 07:56
-
-
Save emmabostian/e7979a18d85a292240ca1cccfdebbfdf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import Recipe from './Recipe'; | |
| class App extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| recipes: [ | |
| { | |
| title: 'Bagel', | |
| ingredients: [ | |
| '1 Bagel', | |
| 'Cream cheese' | |
| ], | |
| steps: [ | |
| 'Slice bagel in half', | |
| 'Spread on cream cheese', | |
| 'Enjoy!' | |
| ], | |
| id: 'bagel' | |
| }, | |
| { | |
| title: 'Pizza', | |
| ingredients: [ | |
| '1 Pizza Crust', | |
| '1 Jar of Pizza Sauce', | |
| '3 oz Part-Skim Mozerella Cheese' | |
| ], | |
| steps: [ | |
| 'Put sauce on crust', | |
| 'Sprinkle mozarella cheese over sauce', | |
| 'Bake at 350 degrees for 20 minutes' | |
| ], | |
| id: 'pizza' | |
| }, | |
| ] | |
| } | |
| } | |
| render() { | |
| return ( | |
| <div className="App"> | |
| <h1>React Recipe Book</h1> | |
| { | |
| this.state.recipes.map((recipe, i) => | |
| <Recipe | |
| title={recipe.title} | |
| ingredients={recipe.ingredients} | |
| steps={recipe.steps} | |
| key={i} | |
| /> | |
| ) | |
| } | |
| </div> | |
| ); | |
| } | |
| } | |
| export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment