From 5e2b53b85e22d65a73b0b4df319f901ac6b4ba35 Mon Sep 17 00:00:00 2001 From: Deandre Crayton Date: Wed, 24 Jan 2018 19:31:17 -0600 Subject: [PATCH 1/2] prop practice --- src/App.js | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/App.js b/src/App.js index 2fe6d64..ccd2d55 100644 --- a/src/App.js +++ b/src/App.js @@ -10,55 +10,61 @@ function App(props) { name: "ajax", description: "Cleans your bathroom real good" }; + const soda = { + name: "pepsi" + }; + const shoe = { + name: "nike" + } const names = ["Bob", "Stand", "Todd", "Ted"]; return (
{/* send in a prop called "message", give it the string "Hello World" */}
This better say "Hello World":
{/* send in a prop called "message", give it the string "Goodbye World" */} -
This better say "Goodbye World":
+
This better say "Goodbye World":
{/* send in a prop called "message", give it the string "Props are awesome" */} -
This better say "Props are awesome":
+
This better say "Props are awesome":
{/* send in a prop called "message", give it the string "I totally get this now" */} -
This better say "I totally get this now":
+
This better say "I totally get this now":
{/* send in a prop called "magicNumber", give it the number 42*/} -
This better say 42:
+
This better say 42:
{/* send in a prop called "magicNumber", give it the number 21*/} -
This better say 21:
+
This better say 21:
{/* send in a prop called "product", give it the variable product*/} -
This better say "ajax":
+
This better say "ajax":
{/* send in a prop called "product", give it an object with a name property "pepsi"*/} -
This better say "pepsi":
+
This better say "pepsi":
{/* send in a prop called "product", give it an object with a name property "nike"*/} -
This better say "nike":
+
This better say "nike":
{/* send in a prop called "names", give it the variable names*/} -
This better say "Bob, Stand, Todd, Ted" :
+
This better say "Bob, Stand, Todd, Ted" :
{/* send in a prop called "names", give it an array ["Brodie","Alicia","Margo"]*/} -
This better say "Brodie, Alicia, Margo" :
+
This better say "Brodie, Alicia, Margo" :
{/* send in a prop called "names", give it an array ["Titus","Axel","Claire"]*/} -
This better say "Titus, Axel, Claire" :
+
This better say "Titus, Axel, Claire" :
{/* Use App's props*/} {/* send in a prop called "products", give it the products array from App's props*/} -
This better say "Hand Sanitizer":
+
This better say "Hand Sanitizer":
{/* send in a prop called "names", give it the names array from App's props*/} -
This better say "Robin, Lily, Barney":
+
This better say "Robin, Lily, Barney":
{/* send in a prop called "magicNumber", give it the magicNumber from App's props*/} -
This better say "99":
+
This better say "99":
{/* send in a prop called "message", give it the contact.firstName from App's props*/} -
This better say "Luke":
+
This better say "Luke":
{/* send in a prop called "message", give it the contact.lastName from App's props*/} -
This better say "Skywalker":
+
This better say "Skywalker":
{/* send in a prop called "message", give it the contact.occupation from App's props*/} -
This better say "farmer":
+
This better say "farmer":
{/* send in a prop called "message", give it the contact.address from App's props*/} -
This better say "300 MiddleOfNoWhere st Tatooine":
+
This better say "300 MiddleOfNoWhere st Tatooine":
); From 739585e60d31700cc175436bac52d01372db3ebb Mon Sep 17 00:00:00 2001 From: Deandre Crayton Date: Wed, 24 Jan 2018 20:28:06 -0600 Subject: [PATCH 2/2] changed objects in App.js --- src/App.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/App.js b/src/App.js index ccd2d55..5e457be 100644 --- a/src/App.js +++ b/src/App.js @@ -10,12 +10,6 @@ function App(props) { name: "ajax", description: "Cleans your bathroom real good" }; - const soda = { - name: "pepsi" - }; - const shoe = { - name: "nike" - } const names = ["Bob", "Stand", "Todd", "Ted"]; return (
@@ -38,9 +32,9 @@ function App(props) { {/* send in a prop called "product", give it the variable product*/}
This better say "ajax":
{/* send in a prop called "product", give it an object with a name property "pepsi"*/} -
This better say "pepsi":
+
This better say "pepsi":
{/* send in a prop called "product", give it an object with a name property "nike"*/} -
This better say "nike":
+
This better say "nike":
{/* send in a prop called "names", give it the variable names*/}