Skip to content

Commit 642d4c9

Browse files
vickvasquezcarburo
authored andcommitted
Translated React without JSX (#120)
1 parent 5fa6c04 commit 642d4c9

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

content/docs/react-without-jsx.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ title: React Without JSX
44
permalink: docs/react-without-jsx.html
55
---
66

7-
JSX is not a requirement for using React. Using React without JSX is especially convenient when you don't want to set up compilation in your build environment.
7+
JSX no es un requisito para usar React. Usar React sin JSX es especialmente conveniente cuando no quieres configurar herramientas de compilación en tu entorno de desarrollo.
88

9-
Each JSX element is just syntactic sugar for calling `React.createElement(component, props, ...children)`. So, anything you can do with JSX can also be done with just plain JavaScript.
9+
Cada elemento JSX es solamente azúcar sintáctico para llamar a `React.createElement(component, props, ...children)`. Por lo tanto, cualquier cosa que se pueda hacer con JSX se puede hacer con Javascript puro.
1010

11-
For example, this code written with JSX:
11+
Por ejemplo, este código escrito con JSX:
1212

1313
```js
1414
class Hello extends React.Component {
@@ -23,7 +23,7 @@ ReactDOM.render(
2323
);
2424
```
2525

26-
can be compiled to this code that does not use JSX:
26+
se puede compilar a este que no usa JSX:
2727

2828
```js
2929
class Hello extends React.Component {
@@ -38,11 +38,11 @@ ReactDOM.render(
3838
);
3939
```
4040

41-
If you're curious to see more examples of how JSX is converted to JavaScript, you can try out [the online Babel compiler](babel://jsx-simple-example).
41+
Si tienes curiosidad por ver más ejemplos de cómo JSX se convierte a Javascript, puedes probar el [compilador en línea de Babel](babel://jsx-simple-example).
4242

43-
The component can either be provided as a string, or as a subclass of `React.Component`, or a plain function for stateless components.
43+
El componente puede ser proporcionado como una cadena, como una subclase de `React.Component`, o una función simple para componentes sin estado.
4444

45-
If you get tired of typing `React.createElement` so much, one common pattern is to assign a shorthand:
45+
Si te cansas de escribir tanto `React.createElement`, un patrón común es asignarlo a una variable corta:
4646

4747
```js
4848
const e = React.createElement;
@@ -53,7 +53,6 @@ ReactDOM.render(
5353
);
5454
```
5555

56-
If you use this shorthand form for `React.createElement`, it can be almost as convenient to use React without JSX.
57-
58-
Alternatively, you can refer to community projects such as [`react-hyperscript`](https://github.com/mlmorg/react-hyperscript) and [`hyperscript-helpers`](https://github.com/ohanhi/hyperscript-helpers) which offer a terser syntax.
56+
Si usas esta forma abreviada para `React.createElement`, puede ser casi tan conveniente usar React sin JSX.
5957

58+
Alternativamente, puedes remitirte a proyectos comunitarios como [`react-hyperscript`](https://github.com/mlmorg/react-hyperscript) y [`hyperscript-helpers`](https://github.com/ohanhi/hyperscript-helpers) que ofrecen una sintaxis más concisa.

0 commit comments

Comments
 (0)