diff --git a/.learn/resets/01-hello-world/app.jsx b/.learn/resets/01-hello-world/app.jsx new file mode 100644 index 00000000..556bb60d --- /dev/null +++ b/.learn/resets/01-hello-world/app.jsx @@ -0,0 +1,12 @@ +import React from "react"; // Main React.js library + +import ReactDOM from "react-dom"; // We use ReactDOM to render into the DOM + +// WHAT: This variable contains the html to render +let output = James is 12 years old; + +// WHERE: A DOM element that will contain the entire react generated html +const myDiv = document.querySelector("#myDiv"); + + //what //where +ReactDOM.render(output, myDiv); diff --git a/.learn/resets/01.1-hello-jsx/app.jsx b/.learn/resets/01.1-hello-jsx/app.jsx new file mode 100644 index 00000000..dc9c3ecf --- /dev/null +++ b/.learn/resets/01.1-hello-jsx/app.jsx @@ -0,0 +1,12 @@ +import React from "react"; +import ReactDOM from "react-dom"; + +// If we have a variable +let age = "12"; +let name = "John"; + +// We can use it in our html like this +let output = James is {age} years old; + +// Use react-dom to render it +ReactDOM.render(output, document.querySelector("#myDiv")); diff --git a/.learn/resets/01.2-rendering-from-objects/app.jsx b/.learn/resets/01.2-rendering-from-objects/app.jsx new file mode 100644 index 00000000..466a244b --- /dev/null +++ b/.learn/resets/01.2-rendering-from-objects/app.jsx @@ -0,0 +1,13 @@ +import React from "react"; +import ReactDOM from "react-dom"; + +const customer = { + first_name: "Bob", + last_name: "Dylan" +}; + +// Your code inside these
tags +const output =
; + +// what where +ReactDOM.render(output, document.querySelector("#myDiv")); diff --git a/.learn/resets/01.3-building-a-layout/app.jsx b/.learn/resets/01.3-building-a-layout/app.jsx new file mode 100644 index 00000000..3d27faa1 --- /dev/null +++ b/.learn/resets/01.3-building-a-layout/app.jsx @@ -0,0 +1,20 @@ +import React from "react"; // Main React.js library +import ReactDOM from "react-dom"; // We use ReactDOM to render into the DOM + +const data = { + image: "../../.learn/assets/Dylan.png?raw=true", + cardTitle: "Bob Dylan", + cardDescription: + "Bob Dylan (born Robert Allen Zimmerman, May 24, 1941) is an American singer-songwriter, author, and artist who has been an influential figure in popular music and culture for more than five decades.", + button: { + url: "https://en.wikipedia.org/wiki/Bob_Dylan", + label: "Go to wikipedia", + }, +}; + +// Modify the 'content' variable below to display the desired bootstrap card +let content = ( + +); + +ReactDOM.render(content, document.querySelector("#myDiv")); diff --git a/.learn/resets/01.4-building-html-from-arrays/app.jsx b/.learn/resets/01.4-building-html-from-arrays/app.jsx new file mode 100644 index 00000000..044bde7d --- /dev/null +++ b/.learn/resets/01.4-building-html-from-arrays/app.jsx @@ -0,0 +1,9 @@ +import React from "react"; // Main React.js library +import ReactDOM from "react-dom"; // We use ReactDOM to render into the DOM + +// Only update the value of this array +const navlinkItems = []; + +const content = ; + +ReactDOM.render(content, document.querySelector("#myDiv")); diff --git a/.learn/resets/02-maping-array-to-li/app.jsx b/.learn/resets/02-maping-array-to-li/app.jsx new file mode 100644 index 00000000..d2efa909 --- /dev/null +++ b/.learn/resets/02-maping-array-to-li/app.jsx @@ -0,0 +1,13 @@ +import React from "react"; +import ReactDOM from "react-dom"; + +const animals = ["Horse", "Turtle", "Elephant", "Monkey"]; + +/** + * Change the content inside the map function + **/ +const animalsInHTML = animals.map((singleAnimal, index) => { + return
  • hello
  • ; +}); + +ReactDOM.render(, document.querySelector("#myDiv")); diff --git a/.learn/resets/02.1-maping-array-objects-to-li/app.jsx b/.learn/resets/02.1-maping-array-objects-to-li/app.jsx new file mode 100644 index 00000000..87006bcb --- /dev/null +++ b/.learn/resets/02.1-maping-array-objects-to-li/app.jsx @@ -0,0 +1,13 @@ +import React from "react"; +import ReactDOM from "react-dom"; + +const animals = [{ label: "Horse" }, { label: "Turtle" }, { label: "Elephant" }, { label: "Monkey" }]; + +/** + * Change the content of the map function + **/ +const animalsInHTML = animals.map((singleAnimal, index) => { + return
  • hello
  • ; +}); + +ReactDOM.render(, document.querySelector("#myDiv")); diff --git a/.learn/resets/02.2-maping-array-of-objects-to-li/app.jsx b/.learn/resets/02.2-maping-array-of-objects-to-li/app.jsx new file mode 100644 index 00000000..a933d112 --- /dev/null +++ b/.learn/resets/02.2-maping-array-of-objects-to-li/app.jsx @@ -0,0 +1,16 @@ +import React from "react"; +import ReactDOM from "react-dom"; + +const planets = ["Mars", "Venus", "Jupiter", "Earth", "Saturn", "Neptune"]; + +/** + * 1) Create the mapping function and use it to generate a new array of + * planets in html called planetsInHTML + */ + + + +// 2) Add the array planetsInHTML inside the innerHTML of this