You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Este proyecto sigue las especificaciones: [all-contributors](https://github.com/kentcdodds/all-contributors).
40
38
41
39
¡Todas las contribuciones son bienvenidas!
42
40
43
41
### Nota:
44
-
> 🔹 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.
42
+
> 🔹 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.
45
43
46
44
Haz clic en `next` arriba de estas instrucciones para empezar con el primer ejercicio...
Copy file name to clipboardExpand all lines: exercises/01-hello-world/README.es.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# `01` Hello world
1
+
# `01` Hello World
2
2
3
3
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.
4
4
@@ -14,24 +14,24 @@ La función `ReactDOM.render` recibe dos parámetros:
14
14
15
15
Por ejemplo:
16
16
17
-
```js
18
-
importReactfrom'react'; //importar la librería de react
19
-
importReactDOMfrom'react-dom'; //importar react-dom para que react genere el html
17
+
```jsx
18
+
importReactfrom'react'; //importar la librería de react
19
+
importReactDOMfrom'react-dom'; //importar react-dom para que react genere el html
20
20
21
-
//QUE: esta variable contiene todo el HTML que va a ser renderizado
21
+
//QUÉ: esta variable contiene todo el HTML que va a ser renderizado
22
22
let output =<span>James is 12 years old</span>
23
23
24
-
//DONDE: Un elemento DOM que contendrá todo el html generado por react
24
+
//DÓNDE: Un elemento del DOM que contendrá todo el html generado por react
25
25
constmyDiv=document.querySelector('#myDiv');
26
26
27
-
//qué //dónde
27
+
//qué //dónde
28
28
ReactDOM.render(output, myDiv);
29
29
```
30
30
31
31
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`:
32
32
33
-
```js
34
-
//Así lo harías sin react
33
+
```jsx
34
+
//Así lo harías sin react
35
35
myDiv.innerHTML='<span>James is 12 years old</span>';
36
36
37
37
// Así se hace con react
@@ -44,7 +44,7 @@ ReactDOM.render(<span> James is 12 years old </span>, myDiv);
44
44
45
45
2. Cambia la variable `output` por:
46
46
47
-
```js
47
+
```jsx
48
48
<span>James is <strong>12</strong> years old</span>
Copy file name to clipboardExpand all lines: exercises/01-hello-world/README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Today's biggest pain for front-end developers is **working with the DOM** to cre
8
8
9
9
React.js is a rendering library made to optimize the DOM: developers save time and the browser is faster.
10
10
11
-
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)
11
+
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).
12
12
13
13
The `ReactDOM.render` function receives two parameters:
14
14
@@ -18,27 +18,27 @@ The `ReactDOM.render` function receives two parameters:
18
18
19
19
For example:
20
20
21
-
```js
22
-
importReactfrom'react'; //import the react library
23
-
importReactDOMfrom'react-dom'; //import react-dom to make react generate html
21
+
```jsx
22
+
importReactfrom'react'; //import the react library
23
+
importReactDOMfrom'react-dom'; //import react-dom to make react generate html
24
24
25
-
// WHAT: This variable contains all the HTML that will be rendered
25
+
// WHAT: This variable contains all the html that will be rendered
26
26
let output =<span>James is 12 years old</span>
27
27
28
28
// WHERE: A DOM element that will contain the entire react generated html
29
29
constmyDiv=document.querySelector('#myDiv');
30
30
31
-
//what //where
31
+
//what //where
32
32
ReactDOM.render(output, myDiv);
33
33
```
34
34
35
35
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:
36
36
37
-
```js
38
-
//This is how you would do it without react.
37
+
```jsx
38
+
//This is how you would do it without react
39
39
myDiv.innerHTML='<span>James is 12 years old</span>';
40
40
41
-
// This is not you would do it with react.
41
+
// This is how you would do it with react
42
42
ReactDOM.render(<span> James is 12 years old </span>, myDiv);
@@ -39,4 +39,4 @@ El archivo app.jsx tiene una variable llamada `name` que puede contener un nombr
39
39
40
40
## 📝 Instrucciones:
41
41
42
-
1. Por favor, incluye esa variable dentro del resultado(output) de react, reemplaza la variable por el `James`.
42
+
1. Por favor, incluye esa variable dentro de la variable `output`. Reemplaza la palabra `James` con la nueva variable `name` (recuerda usar las llaves `{}`).
@@ -43,4 +43,4 @@ The app.jsx file has a variable called `name` that can contain a name.
43
43
44
44
## 📝 Instructions:
45
45
46
-
1. Please include that variable inside the react output replace the hard coded word `James` with the variable name (remember the curly brackets `{}`).
46
+
1. Please include that variable inside the `output` variable. Replace the hardcoded word `James` with the `name` variable (remember the curly brackets `{}`).
0 commit comments