diff --git a/exercises/00-welcome/README.es.md b/exercises/00-welcome/README.es.md
index 3ca6080d..bb513dd8 100644
--- a/exercises/00-welcome/README.es.md
+++ b/exercises/00-welcome/README.es.md
@@ -16,9 +16,7 @@ Durante este curso aprenderás los siguientes conceptos:
## Lecturas Útiles:
-+ [https://es.reactjs.org/docs/introducing-jsx.html](https://es.reactjs.org/docs/introducing-jsx.html)
-
-+ [https://es.reactjs.org/](https://es.reactjs.org/)
++ [https://es.react.dev/learn](https://es.react.dev/learn)
## Videos Útiles:
@@ -30,17 +28,17 @@ Durante este curso aprenderás los siguientes conceptos:
Gracias a estas maravillosas personas ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
-1. [Alejandro Sánchez (alesanchezr)](https://github.com/alesanchezr), contribución: (programador) :computer: (idea) 🤔, (build-tests) :warning:, (pull-request-review) :eyes: (build-tutorial) :white_check_mark: (documentación) :book:
+1. [Alejandro Sánchez (alesanchezr)](https://github.com/alesanchezr), contribución: (programador) 💻 (idea) 🤔, (build-tests) ⚠️, (pull-request-review) 👀, (build-tutorial) ✅, (documentación) 📖
-2. [Paolo Lucano (plucodev)](https://github.com/plucodev), contribución: (programador) :computer:, (build-tests) :warning:
+2. [Paolo Lucano (plucodev)](https://github.com/plucodev), contribución: (programador) 💻, (build-tests) ⚠️
-3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribución: (traducción) :earth_africa:
+3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribución: (traducción) 🌍
Este proyecto sigue las especificaciones: [all-contributors](https://github.com/kentcdodds/all-contributors).
¡Todas las contribuciones son bienvenidas!
### Nota:
-> 🔹 Nosotros construimos los ejercicios incrementalmente, deberías sentir el progreso poco a poco, y esperamos que el incremento de la dificuldad entre los ejercicios nunca sea tan grande como para frustrarte.
+> 🔹 Nosotros construimos los ejercicios incrementalmente, deberías sentir el progreso poco a poco, y esperamos que el incremento de la dificultad entre los ejercicios nunca sea tan grande como para frustrarte.
Haz clic en `next` arriba de estas instrucciones para empezar con el primer ejercicio...
diff --git a/exercises/00-welcome/README.md b/exercises/00-welcome/README.md
index 180d300d..9d13409b 100644
--- a/exercises/00-welcome/README.md
+++ b/exercises/00-welcome/README.md
@@ -8,7 +8,7 @@ We are very excited to have you here! 🎉 😂
## 💬 Fundamentals:
-During this course you will be learning the following concepts:
+During this course, you will be learning the following concepts:
1. **Using JSX**: A great syntax proposed by Facebook that mixes HTML and JS in the same file to help you write dynamic HTML.
@@ -34,11 +34,11 @@ During this course you will be learning the following concepts:
Thanks to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
-1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribution: (coder) :computer: (idea) 🤔, (build-tests) :warning:, (pull-request-review) :eyes: (build-tutorial) :white_check_mark: (documentation) :book:
+1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribution: (coder) 💻, (idea) 🤔, (build-tests) ⚠️, (pull-request-review) 👀, (build-tutorial) ✅, (documentation) 📖
-2. [Paolo Lucano (plucodev)](https://github.com/plucodev), contribution: (coder), (build-tests) :warning:
+2. [Paolo Lucano (plucodev)](https://github.com/plucodev), contribution: (coder) 💻, (build-tests) ⚠️
-3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribution: (translator) :earth_africa:
+3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribution: (translator) 🌍
This project follows these specifications: [all-contributors](https://github.com/kentcdodds/all-contributors)
diff --git a/exercises/01-hello-world/README.es.md b/exercises/01-hello-world/README.es.md
index c6e39f60..1941b353 100644
--- a/exercises/01-hello-world/README.es.md
+++ b/exercises/01-hello-world/README.es.md
@@ -1,4 +1,4 @@
-# `01` Hello world
+# `01` Hello World
El mayor dolor de cabeza de los desarrolladores front-end es **trabajar con el DOM** para crear HTML dinámico, lo cual es algo que React.js hace mucho mejor.
@@ -14,24 +14,24 @@ La función `ReactDOM.render` recibe dos parámetros:
Por ejemplo:
-```js
-import React from 'react'; //importar la librería de react
-import ReactDOM from 'react-dom'; //importar react-dom para que react genere el html
+```jsx
+import React from 'react'; // importar la librería de react
+import ReactDOM from 'react-dom'; // importar react-dom para que react genere el html
-// QUE: esta variable contiene todo el HTML que va a ser renderizado
+// QUÉ: esta variable contiene todo el HTML que va a ser renderizado
let output = James is 12 years old
-// DONDE: Un elemento DOM que contendrá todo el html generado por react
+// DÓNDE: Un elemento del DOM que contendrá todo el html generado por react
const myDiv = document.querySelector('#myDiv');
- //qué //dónde
+ //qué //dónde
ReactDOM.render(output, myDiv);
```
La función `ReactDOM.render` establecerá el innerHTML de `myDiv` (un elemento DOM) para ser lo que sea que contenga la variable `output`, muy similar a como funciona `innerHTML`:
-```js
-//Así lo harías sin react
+```jsx
+// Así lo harías sin react
myDiv.innerHTML = 'James is 12 years old';
// Así se hace con react
@@ -44,7 +44,7 @@ ReactDOM.render( James is 12 years old , myDiv);
2. Cambia la variable `output` por:
-```js
+```jsx
James is 12 years old
```
diff --git a/exercises/01-hello-world/README.md b/exercises/01-hello-world/README.md
index 54e11e74..5f8ba9dc 100644
--- a/exercises/01-hello-world/README.md
+++ b/exercises/01-hello-world/README.md
@@ -8,7 +8,7 @@ Today's biggest pain for front-end developers is **working with the DOM** to cre
React.js is a rendering library made to optimize the DOM: developers save time and the browser is faster.
-The library comes with a function called **ReactDOM.render** that you can see as a replacement for the classic [innerHTML property](https://www.w3schools.com/jsref/prop_html_innerhtml.asp)
+The library comes with a function called **ReactDOM.render** that you can see as a replacement for the classic [innerHTML property](https://www.w3schools.com/jsref/prop_html_innerhtml.asp).
The `ReactDOM.render` function receives two parameters:
@@ -18,27 +18,27 @@ The `ReactDOM.render` function receives two parameters:
For example:
-```js
-import React from 'react'; //import the react library
-import ReactDOM from 'react-dom'; //import react-dom to make react generate html
+```jsx
+import React from 'react'; // import the react library
+import ReactDOM from 'react-dom'; // import react-dom to make react generate html
-// WHAT: This variable contains all the HTML that will be rendered
+// WHAT: This variable contains all the html that will be rendered
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
+ //what //where
ReactDOM.render(output, myDiv);
```
The function `ReactDOM.render` will set the innerHTML of `myDiv` (a DOM element) to be whatever the variable `output` contains, very similar to how `innerHTML` works:
-```js
-//This is how you would do it without react.
+```jsx
+// This is how you would do it without react
myDiv.innerHTML = 'James is 12 years old';
-// This is not you would do it with react.
+// This is how you would do it with react
ReactDOM.render( James is 12 years old , myDiv);
```
diff --git a/exercises/01-hello-world/app.jsx b/exercises/01-hello-world/app.jsx
index 8f2e3d9a..556bb60d 100644
--- a/exercises/01-hello-world/app.jsx
+++ b/exercises/01-hello-world/app.jsx
@@ -1,12 +1,12 @@
-import React from "react"; //Main React.js library
+import React from "react"; // Main React.js library
-import ReactDOM from "react-dom"; //we use ReactDOM to render into the DOM
+import ReactDOM from "react-dom"; // We use ReactDOM to render into the DOM
-// WHAT: This variable returns contains the html to render
+// 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
+ //what //where
ReactDOM.render(output, myDiv);
diff --git a/exercises/01-hello-world/solution.hide.jsx b/exercises/01-hello-world/solution.hide.jsx
new file mode 100644
index 00000000..963248b8
--- /dev/null
+++ b/exercises/01-hello-world/solution.hide.jsx
@@ -0,0 +1,16 @@
+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 12 years old
+
+);
+
+// Use react-dom to render it
+ReactDOM.render(output, document.querySelector("#myDiv"));
diff --git a/exercises/01.1-hello-jsx/README.es.md b/exercises/01.1-hello-jsx/README.es.md
index 871030f0..aad53c19 100644
--- a/exercises/01.1-hello-jsx/README.es.md
+++ b/exercises/01.1-hello-jsx/README.es.md
@@ -14,10 +14,10 @@ let output = James is { age } years old
Fíjate en la posición de las llaves `{` y `}` envolviendo la variable.
-Después, podemos renderizar todo en contenido en el sitio web usando `ReactDOM.render` así:
+Después, podemos renderizar todo en contenido en el sitio web usando `ReactDOM.render` así:
```jsx
-// usa react-dom para renderizarlo en el DOM
+// Usa react-dom para renderizarlo en el DOM
import ReactDOM from 'react-dom';
//renderizar output //dentro del innerHTML de #myDiv
ReactDOM.render(output, document.querySelector('#myDiv'));
@@ -39,4 +39,4 @@ El archivo app.jsx tiene una variable llamada `name` que puede contener un nombr
## 📝 Instrucciones:
-1. Por favor, incluye esa variable dentro del resultado(output) de react, reemplaza la variable por el `James`.
\ No newline at end of file
+1. Por favor, incluye esa variable dentro de la variable `output`. Reemplaza la palabra `James` con la nueva variable `name` (recuerda usar las llaves `{}`).
diff --git a/exercises/01.1-hello-jsx/README.md b/exercises/01.1-hello-jsx/README.md
index 1fe59e27..f4baf324 100644
--- a/exercises/01.1-hello-jsx/README.md
+++ b/exercises/01.1-hello-jsx/README.md
@@ -4,13 +4,13 @@ tutorial: "https://www.youtube.com/watch?v=Wp8hcH8jScQ"
# `01` Hello JSX
-JSX also allows you to easily include variables into your HTML, for example, lets assume that you have the following variable available:
+JSX also allows you to easily include variables into your HTML. For example, let's assume that you have the following variable available:
```js
let age = 12;
```
-If you want to include the value of that variable into your HTML code dynamically, you can do it like this:
+If you want to include the value of that variable dynamically into your HTML code, you can do it like this:
```jsx
let output = James is { age } years old
@@ -18,10 +18,10 @@ let output = James is { age } years old
Note the position of the curly brackets `{` and `}` wrapping the variable.
-Then, we can render the everything in the website content using `ReactDOM.render` like this:
+Then, we can render everything in the website content using `ReactDOM.render` like this:
```jsx
-// use react-dom to render it into the DOM
+// Use react-dom to render it into the DOM
import ReactDOM from 'react-dom';
//render output //inside the innerHTML of #myDiv
ReactDOM.render(output, document.querySelector('#myDiv'));
@@ -43,4 +43,4 @@ The app.jsx file has a variable called `name` that can contain a name.
## 📝 Instructions:
-1. Please include that variable inside the react output replace the hard coded word `James` with the variable name (remember the curly brackets `{}`).
+1. Please include that variable inside the `output` variable. Replace the hardcoded word `James` with the `name` variable (remember the curly brackets `{}`).
diff --git a/exercises/01.1-hello-jsx/app.jsx b/exercises/01.1-hello-jsx/app.jsx
index c1c3072b..dc9c3ecf 100644
--- a/exercises/01.1-hello-jsx/app.jsx
+++ b/exercises/01.1-hello-jsx/app.jsx
@@ -1,12 +1,12 @@
import React from "react";
import ReactDOM from "react-dom";
-// if we have a variable
+// If we have a variable
let age = "12";
let name = "John";
-// we can use it in our html like this
+// We can use it in our html like this
let output = James is {age} years old;
-// use react-dom to render it
+// Use react-dom to render it
ReactDOM.render(output, document.querySelector("#myDiv"));
diff --git a/exercises/01.1-hello-jsx/solution.hide.jsx b/exercises/01.1-hello-jsx/solution.hide.jsx
new file mode 100644
index 00000000..86158c47
--- /dev/null
+++ b/exercises/01.1-hello-jsx/solution.hide.jsx
@@ -0,0 +1,16 @@
+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 = (
+
+ {name} is {age} years old
+
+);
+
+// Use react-dom to render it
+ReactDOM.render(output, document.querySelector("#myDiv"));
diff --git a/exercises/01.2-rendering-from-objects/README.es.md b/exercises/01.2-rendering-from-objects/README.es.md
index 22dec78d..7bc4062e 100644
--- a/exercises/01.2-rendering-from-objects/README.es.md
+++ b/exercises/01.2-rendering-from-objects/README.es.md
@@ -9,10 +9,10 @@ const customer = {
};
```
-Para obtener cualquier propiedad del objeto `Customer` tenemos que usar el operador punto (`.`), así:
+Para obtener cualquier propiedad del objeto `customer` tenemos que usar el operador punto (`.`), así:
```js
-console.log(customer.first_name); // imprimirá "Bob" en la consola.
+console.log(customer.first_name); // Imprimirá "Bob" en la consola
```
## 📝 Instrucciones:
diff --git a/exercises/01.2-rendering-from-objects/README.md b/exercises/01.2-rendering-from-objects/README.md
index d582ea78..a8f19315 100644
--- a/exercises/01.2-rendering-from-objects/README.md
+++ b/exercises/01.2-rendering-from-objects/README.md
@@ -4,7 +4,7 @@ tutorial: "https://www.youtube.com/watch?v=Z9gzZoYM4pY"
# `01.2` Rendering from objects
-Now lets use a more complex variable to render our HTML, let's say we have the following JS Object containing a customer information:
+Now, let's use a more complex variable to render our HTML. Let's say we have the following JS object containing a customer's information:
```js
const customer = {
@@ -13,15 +13,15 @@ const customer = {
};
```
-To retrieve any property from the `Customer` object we have to use the dot (`.`) operator, like this:
+To retrieve any property from the `customer` object we have to use the dot (`.`) operator, like this:
```js
-console.log(customer.first_name); // will print "Bob" on the console.
+console.log(customer.first_name); // Will print "Bob" on the console
```
## 📝 Instructions:
-Open the `app.jsx` and create the necesary code to make your file render the following output into the DOM:
+Open the `app.jsx` and create the necessary code to make your file render the following output into the DOM:
```jsx
diff --git a/exercises/01.2-rendering-from-objects/app.jsx b/exercises/01.2-rendering-from-objects/app.jsx
index 7ff4a2ef..466a244b 100644
--- a/exercises/01.2-rendering-from-objects/app.jsx
+++ b/exercises/01.2-rendering-from-objects/app.jsx
@@ -6,8 +6,8 @@ const customer = {
last_name: "Dylan"
};
-// your code inside these
tags
+// Your code inside these
tags
const output =
;
-// what where
+// what where
ReactDOM.render(output, document.querySelector("#myDiv"));
diff --git a/exercises/01.2-rendering-from-objects/solution.hide.jsx b/exercises/01.2-rendering-from-objects/solution.hide.jsx
new file mode 100644
index 00000000..565f483c
--- /dev/null
+++ b/exercises/01.2-rendering-from-objects/solution.hide.jsx
@@ -0,0 +1,18 @@
+import React from "react";
+import ReactDOM from "react-dom";
+
+const customer = {
+ first_name: "Bob",
+ last_name: "Dylan",
+};
+
+// your code inside these
tags
+const output = (
+
+
My name is {customer.first_name}
+ My last name is {customer.last_name}
+
+);
+
+// what where
+ReactDOM.render(output, document.querySelector("#myDiv"));
diff --git a/exercises/01.2-rendering-from-objects/tests.js b/exercises/01.2-rendering-from-objects/tests.js
index 2d7139ee..c37bb1ce 100644
--- a/exercises/01.2-rendering-from-objects/tests.js
+++ b/exercises/01.2-rendering-from-objects/tests.js
@@ -13,7 +13,7 @@ test("ReactDOM.render needs to be called once", () => {
expect(ReactDOM.render.mock.calls.length).toBe(1);
});
-test("The component should return LITERALLY what was asked", () => {
+test("The component should exactly match the requested output", () => {
const tree = renderer.create(ReactDOM.render.mock.calls[0][0]).toJSON();
expect(tree).toMatchInlineSnapshot(`
diff --git a/exercises/01.3-building-a-layout/README.es.md b/exercises/01.3-building-a-layout/README.es.md
index bf7bd49a..6d73766d 100644
--- a/exercises/01.3-building-a-layout/README.es.md
+++ b/exercises/01.3-building-a-layout/README.es.md
@@ -4,7 +4,7 @@ Practiquemos un poco más el uso del JSX para crear HTML.
Ahora tenemos otro objeto que es solo un poco más complejo que el anterior.
- ¿Estas listo? 😃
+¿Estás listo? 😃
Tienes un objeto `data` que contiene la información de Bob Dylan (imagen, título, etc).
@@ -20,15 +20,15 @@ const data = {
};
```
- ## 📝 Instrucciones:
+## 📝 Instrucciones:
-1. Usa esa información contenida en `data` para renderizar una tarjeta bootstrap (bootstrap card): por ejemplo el título de la tarjeta sería el `data.cardTitle`, etc.
+1. Usa la información contenida en `data` para renderizar una tarjeta de bootstrap. Por ejemplo, el título de la tarjeta sería `data.cardTitle`, etc.
- ## Resultado esperado:
+## 💻 Resultado esperado:
- ![Bob Dylan Card](../../.learn/assets/1.4-1.png?raw=true)
+![Tarjeta de Bob Dylan](../../.learn/assets/1.4-1.png?raw=true)
- ## 💡 Pista:
+## 💡 Pista:
+ Aquí está el código HTML para crear una tarjeta en bootstrap:
@@ -43,5 +43,5 @@ const data = {
```
-Fuente: [Bootstrap Card](https://getbootstrap.com/docs/4.0/components/card/#example)
+Fuente: [Bootstrap Card](https://getbootstrap.com/docs/5.0/components/card/#example)
diff --git a/exercises/01.3-building-a-layout/README.md b/exercises/01.3-building-a-layout/README.md
index 5abc6d69..31f4d93d 100644
--- a/exercises/01.3-building-a-layout/README.md
+++ b/exercises/01.3-building-a-layout/README.md
@@ -23,13 +23,14 @@ const data = {
}
};
```
+
## 📝 Instructions:
-1. Use the information contained in `data` to render a bootstrap card, for example: The card's title will be the `data.cardTitle`, etc.
+1. Use the information contained in `data` to render a bootstrap card. For example: The card's title will be `data.cardTitle`, etc.
- ## Expected result:
+## 💻 Expected result:
- ![Bob Dylan Card](../../.learn/assets/1.4-1.png?raw=true)
+![Bob Dylan Card](../../.learn/assets/1.4-1.png?raw=true)
## 💡 Hint:
@@ -46,7 +47,7 @@ const data = {
```
-Source: [Bootstrap Card](https://getbootstrap.com/docs/4.0/components/card/#example)
+Source: [Bootstrap Card](https://getbootstrap.com/docs/5.0/components/card/#example)
diff --git a/exercises/01.3-building-a-layout/app.jsx b/exercises/01.3-building-a-layout/app.jsx
index e6ffec73..3d27faa1 100644
--- a/exercises/01.3-building-a-layout/app.jsx
+++ b/exercises/01.3-building-a-layout/app.jsx
@@ -1,5 +1,5 @@
-import React from "react"; //Main React.js library
-import ReactDOM from "react-dom"; //we use ReactDOM to render into the DOM
+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",
@@ -12,12 +12,9 @@ const data = {
},
};
+// Modify the 'content' variable below to display the desired bootstrap card
let content = (
);
-/**
- * define the variable 'content' here and fill it with the
- * needed code to render the bootstrap card
- **/
ReactDOM.render(content, document.querySelector("#myDiv"));
diff --git a/exercises/01.3-building-a-layout/solution.hide.jsx b/exercises/01.3-building-a-layout/solution.hide.jsx
index 886a8273..7c16c1e5 100644
--- a/exercises/01.3-building-a-layout/solution.hide.jsx
+++ b/exercises/01.3-building-a-layout/solution.hide.jsx
@@ -1,5 +1,5 @@
-import React from "react"; //Main React.js library
-import ReactDOM from "react-dom"; //we use ReactDOM to render into the DOM
+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",
@@ -12,6 +12,7 @@ const data = {
},
};
+// Modify the 'content' variable below to display the desired bootstrap card
let content = (
@@ -24,9 +25,5 @@ let content = (
);
-/**
- * define the variable 'content' here and fill it with the
- * needed code to render the bootstrap card
- **/
ReactDOM.render(content, document.querySelector("#myDiv"));
diff --git a/exercises/01.4-building-html-from-arrays/README.es.md b/exercises/01.4-building-html-from-arrays/README.es.md
index e1ab52a4..3478c43f 100644
--- a/exercises/01.4-building-html-from-arrays/README.es.md
+++ b/exercises/01.4-building-html-from-arrays/README.es.md
@@ -1,11 +1,11 @@
# `01.4` Building from arrays
-Con JSX también puedes crear **arrays o arreglos** de elementos HTML. Por ejemplo, si tenemos un arreglo de `
` podemos incluirlos todos dentro del documento a la vez, así:
+Con JSX también puedes crear **arrays** de elementos HTML. Por ejemplo, si tenemos un arreglo de `` podemos incluirlos todos dentro del documento a la vez, así:
```jsx
const namesInHTML = [
Bob Dust,
-
Fredy Mercury,
+
Freddie Mercury,
Shazam Nikola,
Wilibin Walabam
];
@@ -21,14 +21,14 @@ El HTML resultante en el sitio web sería así:
- Bob Dust
- - Fredy Mercury
+ - Freddie Mercury
- Shazam Nikola
- Wilibin Walabam
```
-Digamos que queremos que react renderice la siguiente salida en el documento:
+Digamos que queremos que React renderice la siguiente salida en el documento:
```html
@@ -52,6 +52,6 @@ Digamos que queremos que react renderice la siguiente salida en el documento:
+ Solo tienes que actualizar el arreglo `navlinkItems`, nada más.
-+ React te pedirá usar keys en cada elemento del arreglo. Puedes leer más al respecto aquí: [https://reactjs.org/docs/lists-and-keys.html#keys](https://reactjs.org/docs/lists-and-keys.html#keys).
++ React te pedirá usar keys en cada elemento del arreglo. Puedes leer más al respecto aquí: [https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key](https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key).
-+ Recuerda usar `className` en lugar de `class`.
\ No newline at end of file
++ Recuerda usar `className` en lugar de `class`.
diff --git a/exercises/01.4-building-html-from-arrays/README.md b/exercises/01.4-building-html-from-arrays/README.md
index 8e1824c9..820ad727 100644
--- a/exercises/01.4-building-html-from-arrays/README.md
+++ b/exercises/01.4-building-html-from-arrays/README.md
@@ -4,12 +4,12 @@ tutorial: "https://www.youtube.com/watch?v=mFPtdyHeKVM"
# `01.4` Building from arrays
-With JSX you can also create **arrays** of HTML items. For example, if we have an array of `- ` we can include all of them into the document at once like this:
+With JSX you can also create **arrays** of HTML items. For example, if we have an array of `
- ` we can include all of them into the document at once, like this:
```jsx
const namesInHTML = [
- Bob Dust
,
- - Fredy Mercury
,
+ - Freddie Mercury
,
- Shazam Nikola
,
- Wilibin Walabam
];
@@ -25,14 +25,14 @@ The resulting HTML on the website will be:
- Bob Dust
- - Fredy Mercury
+ - Freddie Mercury
- Shazam Nikola
- Wilibin Walabam
```
-Lets say that we want react to render the following output into the document:
+Lets say that we want React to render the following output into the document:
```html
@@ -56,6 +56,6 @@ Lets say that we want react to render the following output into the document:
+ You only have to update the `navlinkItems` array, nothing else.
-+ React will ask you to use keys on each item of the array. You can read more about it here: [https://reactjs.org/docs/lists-and-keys.html#keys](https://reactjs.org/docs/lists-and-keys.html#keys).
++ React will ask you to use keys on each item of the array. You can read more about it here: [https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key](https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key).
-+ Remember to use `className` instead of `class`.
\ No newline at end of file
++ Remember to use `className` instead of `class`.
diff --git a/exercises/01.4-building-html-from-arrays/app.jsx b/exercises/01.4-building-html-from-arrays/app.jsx
index 972c193f..044bde7d 100644
--- a/exercises/01.4-building-html-from-arrays/app.jsx
+++ b/exercises/01.4-building-html-from-arrays/app.jsx
@@ -1,7 +1,7 @@
-import React from "react"; //Main React.js library
-import ReactDOM from "react-dom"; //we use ReactDOM to render into the DOM
+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
+// Only update the value of this array
const navlinkItems = [];
const content = ;
diff --git a/exercises/01.4-building-html-from-arrays/solution.hide.jsx b/exercises/01.4-building-html-from-arrays/solution.hide.jsx
new file mode 100644
index 00000000..e61c6c9a
--- /dev/null
+++ b/exercises/01.4-building-html-from-arrays/solution.hide.jsx
@@ -0,0 +1,25 @@
+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 = [
+ -
+
+ Link to google.com
+
+
,
+ -
+
+ Link to facebook.com
+
+
,
+ -
+
+ Link to amazon.com
+
+
,
+];
+
+const content = ;
+
+ReactDOM.render(content, document.querySelector("#myDiv"));
diff --git a/exercises/02-maping-array-to-li/README.es.md b/exercises/02-maping-array-to-li/README.es.md
index a345a7b7..eb82c187 100644
--- a/exercises/02-maping-array-to-li/README.es.md
+++ b/exercises/02-maping-array-to-li/README.es.md
@@ -10,7 +10,7 @@ const animals = [ 'Horse', 'Turtle', 'Elephant', 'Monkey' ];
## 📝 Instrucciones:
-1. Actualiza la [función .map](https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d) del código para crear un nuevo arreglo de `- ` donde cada uno de ellos corresponde a un animal del arreglo original, el arreglo resultante debería ser algo como esto:
+1. Actualiza la [función map()](https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d) del código para crear un nuevo arreglo de `
- ` donde cada uno de ellos corresponde a un animal del arreglo original, el arreglo resultante debería ser algo como esto:
```jsx
const animalsInHTML = [
@@ -23,9 +23,9 @@ const animalsInHTML = [
2. Luego, inclúyelos todos juntos en el sitio web.
-## Resultado esperado:
+## 💻 Resultado esperado:
-Tu sitio web debería verse algo así: ![li's](../../.learn/assets/02-1.png?raw=true)
+![resultado esperado de li's](../../.learn/assets/02-1.png?raw=true)
## 💡 Pista:
diff --git a/exercises/02-maping-array-to-li/README.md b/exercises/02-maping-array-to-li/README.md
index c0c031e6..c02f5e4f 100644
--- a/exercises/02-maping-array-to-li/README.md
+++ b/exercises/02-maping-array-to-li/README.md
@@ -14,7 +14,7 @@ const animals = [ 'Horse', 'Turtle', 'Elephant', 'Monkey' ];
## 📝 Instructions:
-1. Update the code's [.map function](https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d) to create a new array of `
- `'s that each of them corresponds one animal from the original array, the resulting array should be something like this:
+1. Update the code's [map() function](https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d) to create a new array of `
- `'s that corresponds to each animal from the original array, the resulting array should be something like this:
```jsx
const animalsInHTML = [
@@ -25,12 +25,12 @@ const animalsInHTML = [
];
```
-And include them all together inside the website.
+2. Include them all together inside your website.
-## Expected result:
+## 💻 Expected result:
-Your website should look like this: ![Li's](../../.learn/assets/02-1.png?raw=true)
+![expected result of li's](../../.learn/assets/02-1.png?raw=true)
## 💡 Hint:
-+ You can use the second parameter of the map function as a `key` to uniquely identify each html item.
++ You can use the second parameter of the map function as a `key` to uniquely identify each HTML item.
diff --git a/exercises/02-maping-array-to-li/app.jsx b/exercises/02-maping-array-to-li/app.jsx
index 801555fb..d2efa909 100644
--- a/exercises/02-maping-array-to-li/app.jsx
+++ b/exercises/02-maping-array-to-li/app.jsx
@@ -4,9 +4,9 @@ import ReactDOM from "react-dom";
const animals = ["Horse", "Turtle", "Elephant", "Monkey"];
/**
- * change the content inside the map function
+ * Change the content inside the map function
**/
-const animalsInHTML = animals.map((singleAnimal, i) => {
+const animalsInHTML = animals.map((singleAnimal, index) => {
return
- hello
;
});
diff --git a/exercises/02-maping-array-to-li/solution.hide.jsx b/exercises/02-maping-array-to-li/solution.hide.jsx
new file mode 100644
index 00000000..2447bede
--- /dev/null
+++ b/exercises/02-maping-array-to-li/solution.hide.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 - {singleAnimal}
;
+});
+
+ReactDOM.render(, document.querySelector("#myDiv"));
diff --git a/exercises/02-maping-array-to-li/tests.js b/exercises/02-maping-array-to-li/tests.js
index b8e0ce76..b9c5e0f4 100644
--- a/exercises/02-maping-array-to-li/tests.js
+++ b/exercises/02-maping-array-to-li/tests.js
@@ -33,10 +33,10 @@ test("The component should return the exact HTML", () => {
`);
});
-test("You should use singleAnimal to get the anima for each of the iterations", () => {
+test("You should use singleAnimal to get the animal for each of the iterations", () => {
expect(app_content).toMatch("{singleAnimal}");
})
-test("You should add the key for each of them and it should be unique", () => {
- expect(app_content).toMatch("key={i}");
-})
\ No newline at end of file
+test("You should assign a unique key for each - using the 'index' parameter on the map function", () => {
+ expect(app_content).toMatch("key={index}");
+})
diff --git a/exercises/02.1-maping-array-objects-to-li/README.es.md b/exercises/02.1-maping-array-objects-to-li/README.es.md
index b265f9e3..dffdc343 100644
--- a/exercises/02.1-maping-array-objects-to-li/README.es.md
+++ b/exercises/02.1-maping-array-objects-to-li/README.es.md
@@ -1,6 +1,6 @@
# `02.1` Mapping array objects to `
- `
-Usando el conocimiento que tienes del ejercicio anterior, ahora corrijamos la función `.map` nuevamente, pero esta vez, partiendo de un arreglo de objetos.
+Usando el conocimiento que tienes del ejercicio anterior, ahora corrijamos la función `map()` nuevamente, pero esta vez, partiendo de un arreglo de objetos.
```js
const animals = [ { label: 'Horse' }, { label: 'Turtle' }, { label: 'Elephant' }, { label: 'Monkey' } ];
@@ -8,11 +8,7 @@ const animals = [ { label: 'Horse' }, { label: 'Turtle' }, { label: 'Elephant' }
## 📝 Instrucciones:
-1. Actualiza la [función .map](https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d) del código para crear un nuevo arreglo de `
- `'s, donde cada `
- ` corresponda a un animal del arreglo original,
-
-2. Inclúyelos juntos en el sitio web.
-
-## Resultado esperado:
+1. Actualiza la [función map()](https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d) del código para crear un nuevo arreglo de `
- ` donde cada uno de ellos corresponde a un animal del arreglo original, el arreglo resultante debería ser algo como esto:
```jsx
const animalsInHTML = [
@@ -23,10 +19,12 @@ const animalsInHTML = [
];
```
+2. Luego, inclúyelos todos juntos en el sitio web.
+
## 💡 Pista:
-+ Puedes usar el segundo parametro de la función map como una `key` para identificar de forma única cada elemento html.
++ Puedes usar el segundo parámetro de la función map como una `key` para identificar de forma única cada elemento HTML.
-## Resultado esperado:
+## 💻 Resultado esperado:
-Tu sitio web debería verse así: ![li's](../../.learn/assets/02.1-1.png?raw=true)
+![resultado esperado de li's](../../.learn/assets/02.1-1.png?raw=true)
diff --git a/exercises/02.1-maping-array-objects-to-li/README.md b/exercises/02.1-maping-array-objects-to-li/README.md
index fd7ebdd9..f44eabf0 100644
--- a/exercises/02.1-maping-array-objects-to-li/README.md
+++ b/exercises/02.1-maping-array-objects-to-li/README.md
@@ -4,7 +4,7 @@ tutorial: "https://www.youtube.com/watch?v=Gw6i3BWzwNY"
# `02.1` Mapping array objects to `
- `
-Using the knowledge you have from the previous example, now lets fix the `.map` function again, but this time, starting from an array of objects.
+Using the knowledge you have from the previous example, now let's fix the `map()` function again, but this time starting from an array of objects.
```js
const animals = [ { label: 'Horse' }, { label: 'Turtle' }, { label: 'Elephant' }, { label: 'Monkey' } ];
@@ -12,11 +12,7 @@ const animals = [ { label: 'Horse' }, { label: 'Turtle' }, { label: 'Elephant' }
## 📝 Instructions:
-1. Update the code's [.map function](https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d) to create a new array of `
- `'s that each of them corresponds one animal from the original array and
-
-2. Include them all together inside the website.
-
-## Expected result:
+1. Update the code's [map() function](https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d) to create a new array of `
- `'s that corresponds to each animal from the original array, the resulting array should be something like this:
```jsx
const animalsInHTML = [
@@ -26,10 +22,13 @@ const animalsInHTML = [
- Monkey
];
```
+
+2. Include them all together inside your website.
+
## 💡 Hint:
-+ You can use the second parameter of the map function as a `key` to uniquely identify each html item.
++ You can use the second parameter of the map function as a `key` to uniquely identify each HTML item.
-## Expected result:
+## 💻 Expected result:
-Your website should look like this: ![Li's](../../.learn/assets/02.1-1.png?raw=true)
+![expected result of li's](../../.learn/assets/02.1-1.png?raw=true)
diff --git a/exercises/02.1-maping-array-objects-to-li/app.jsx b/exercises/02.1-maping-array-objects-to-li/app.jsx
index fbe0b8f3..87006bcb 100644
--- a/exercises/02.1-maping-array-objects-to-li/app.jsx
+++ b/exercises/02.1-maping-array-objects-to-li/app.jsx
@@ -4,9 +4,9 @@ import ReactDOM from "react-dom";
const animals = [{ label: "Horse" }, { label: "Turtle" }, { label: "Elephant" }, { label: "Monkey" }];
/**
- * change the content of the map function
+ * Change the content of the map function
**/
-const animalsInHTML = animals.map((singleAnimal, i) => {
+const animalsInHTML = animals.map((singleAnimal, index) => {
return - hello
;
});
diff --git a/exercises/02.1-maping-array-objects-to-li/solution.hide.jsx b/exercises/02.1-maping-array-objects-to-li/solution.hide.jsx
new file mode 100644
index 00000000..97f1e3b8
--- /dev/null
+++ b/exercises/02.1-maping-array-objects-to-li/solution.hide.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 - {singleAnimal.label}
;
+});
+
+ReactDOM.render(, document.querySelector("#myDiv"));
diff --git a/exercises/02.1-maping-array-objects-to-li/tests.js b/exercises/02.1-maping-array-objects-to-li/tests.js
index e0acf6ed..643e644d 100644
--- a/exercises/02.1-maping-array-objects-to-li/tests.js
+++ b/exercises/02.1-maping-array-objects-to-li/tests.js
@@ -37,6 +37,6 @@ test("You should use singleAnimal to get the animal for each of the iterations",
expect(app_content).toMatch(/{\s*singleAnimal.label\s*}/g);
})
-test("You should add the key for each of them and it should be unique", () => {
- expect(app_content).toMatch(/key\s*=\s*{\s*i\s*}/)
+test("You should assign a unique key for each - using the 'index' parameter on the map function", () => {
+ expect(app_content).toMatch(/key\s*=\s*{\s*index\s*}/)
})
diff --git a/exercises/02.2-maping-array-of-objects-to-li/README.es.md b/exercises/02.2-maping-array-of-objects-to-li/README.es.md
index bbe5c56b..99c07e28 100644
--- a/exercises/02.2-maping-array-of-objects-to-li/README.es.md
+++ b/exercises/02.2-maping-array-of-objects-to-li/README.es.md
@@ -8,22 +8,22 @@ Por ejemplo:
const originalData = [];
const mappingFunction = (item, index) => {
- // devolver algo en JSX.
+ // Devuelve algo en JSX
};
const htmlList = originalData.map(mappingFunction);
-// la variable htmlList ahora contiene un nuevo arreglo.
+// La variable htmlList ahora contiene un nuevo arreglo
```
## 📝 Instrucciones:
-1. Usa el componente [list-group de bootstrap](https://getbootstrap.com/docs/4.1/components/list-group/#basic-example) para renderizar una lista de planetas de un arreglo dado:
+1. Usa el componente [list-group de bootstrap](https://getbootstrap.com/docs/5.0/components/list-group/#basic-example) para renderizar una lista de planetas de un arreglo dado:
```js
const planets = [ 'Mars', 'Venus', 'Jupiter', 'Earth', 'Saturn', 'Neptune' ];
```
-2. Usa la [función .map](https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d) y haz que la salida de tu algoritmo sea el siguiente HTML:
+2. Usa la [función map()](https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d) y haz que la salida de tu algoritmo sea el siguiente HTML:
```jsx
@@ -36,8 +36,8 @@ const planets = [ 'Mars', 'Venus', 'Jupiter', 'Earth', 'Saturn', 'Neptune' ];
```
-3. Incluye todo junto en tu sitio web.
+3. Incluye todo en tu sitio web.
-## Resultado esperado:
+## 💻 Resultado esperado:
-![list-group](../../.learn/assets/02.2-1.png?raw=true)
+![resultado de list-group](../../.learn/assets/02.2-1.png?raw=true)
diff --git a/exercises/02.2-maping-array-of-objects-to-li/README.md b/exercises/02.2-maping-array-of-objects-to-li/README.md
index 6a980648..230b8a18 100644
--- a/exercises/02.2-maping-array-of-objects-to-li/README.md
+++ b/exercises/02.2-maping-array-of-objects-to-li/README.md
@@ -12,22 +12,22 @@ For example:
const originalData = [];
const mappingFunction = (item, index) => {
- // return something in JSX.
+ // return something in JSX
};
const htmlList = originalData.map(mappingFunction);
-// the htmlList variable now contains a new array.
+// The htmlList variable now contains a new array
```
# 📝 Instructions:
-1. Use the [list-group bootstrap](https://getbootstrap.com/docs/4.1/components/list-group/#basic-example) component to render a list of planets from a given array:
+1. Use the [list-group bootstrap](https://getbootstrap.com/docs/5.0/components/list-group/#basic-example) component to render a list of planets from a given array:
```js
const planets = [ 'Mars', 'Venus', 'Jupiter', 'Earth', 'Saturn', 'Neptune' ];
```
-2. Use the [.map function](https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d) and make your algorithm output the following HTML:
+2. Use the [map() function](https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d) and make your algorithm output the following HTML:
```jsx
@@ -42,6 +42,6 @@ const planets = [ 'Mars', 'Venus', 'Jupiter', 'Earth', 'Saturn', 'Neptune' ];
3. Include them all together inside the website.
-## Expected result:
+## 💻 Expected result:
-![list-group](../../.learn/assets/02.2-1.png?raw=true)
+![list-group expected result](../../.learn/assets/02.2-1.png?raw=true)
diff --git a/exercises/02.2-maping-array-of-objects-to-li/app.jsx b/exercises/02.2-maping-array-of-objects-to-li/app.jsx
index 4f46e932..a933d112 100644
--- a/exercises/02.2-maping-array-of-objects-to-li/app.jsx
+++ b/exercises/02.2-maping-array-of-objects-to-li/app.jsx
@@ -1,5 +1,5 @@
-import React from "react"; //Main React.js library
-import ReactDOM from "react-dom"; //we use ReactDOM to render into the DOM
+import React from "react";
+import ReactDOM from "react-dom";
const planets = ["Mars", "Venus", "Jupiter", "Earth", "Saturn", "Neptune"];
@@ -10,7 +10,7 @@ const planets = ["Mars", "Venus", "Jupiter", "Earth", "Saturn", "Neptune"];
-// 2) add the array planetsInHTML inside the innerHTML of this ul
+// 2) Add the array planetsInHTML inside the innerHTML of this
const content = ();
ReactDOM.render(content, document.querySelector("#myDiv"));
diff --git a/exercises/02.2-maping-array-of-objects-to-li/solution.hide.jsx b/exercises/02.2-maping-array-of-objects-to-li/solution.hide.jsx
new file mode 100644
index 00000000..7f4ecd84
--- /dev/null
+++ b/exercises/02.2-maping-array-of-objects-to-li/solution.hide.jsx
@@ -0,0 +1,21 @@
+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
+ */
+const planetsInHTML = planets.map((planet, index) => {
+ return (
+ -
+ {planet}
+
+ );
+});
+
+// 2) Add the array planetsInHTML inside the innerHTML of this
+const content = ;
+
+ReactDOM.render(content, document.querySelector("#myDiv"));