Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translated React without JSX #120

Merged
merged 3 commits into from
Feb 7, 2019
Merged

Conversation

vickvasquez
Copy link
Contributor

@vickvasquez vickvasquez commented Feb 7, 2019

Copy link
Member

@carburo carburo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to the project @vickvasquez!
For the future, before translating an article you should request it in #4 in order to avoid duplicated effort.
I made some corrections. Check it out and tell me what you think.


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.
Cada elemento JSX es solamente azucar sintactico para llamar `React.createElement(component, props, ...children)`. Por lo tanto, cualquier cosa que se pueda hacer con JSX se puede hacer con Javascript puro.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Cada elemento JSX es solamente azucar sintactico para llamar `React.createElement(component, props, ...children)`. Por lo tanto, cualquier cosa que se pueda hacer con JSX se puede hacer con Javascript puro.
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.

@@ -4,14 +4,14 @@ title: React Without JSX
permalink: docs/react-without-jsx.html
---

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.
JSX no es un requisito para usar React. Usar react sin JSX es especialmente conveniente cuando no necesitas configurar herramientas de compilacion en tu ambiente de desarrollo.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
JSX no es un requisito para usar React. Usar react sin JSX es especialmente conveniente cuando no necesitas configurar herramientas de compilacion en tu ambiente de desarrollo.
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.


```js
class Hello extends React.Component {
class Hello extends React.Component
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yo should not change code samples

Suggested change
class Hello extends React.Component
class Hello extends React.Component {

@@ -22,8 +22,7 @@ ReactDOM.render(
document.getElementById('root')
);
```

can be compiled to this code that does not use JSX:
se puede compilar a este que no usa JSX:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't change the spacing in the line numbers in the original article. It makes our lives easier for reviewing.

Suggested change
se puede compilar a este que no usa JSX:
se puede compilar a este que no usa JSX:

@@ -38,11 +37,11 @@ ReactDOM.render(
);
```

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).
Si tienes curiosidad por ver mas ejemplos de como JSX se convierte a Javascript, puedes probar el [compilador en linea de Babel](babel://jsx-simple-example).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Si tienes curiosidad por ver mas ejemplos de como JSX se convierte a Javascript, puedes probar el [compilador en linea de Babel](babel://jsx-simple-example).
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).


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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
El componente puede ser proporcionada como una cadena, o como una subclase de `React.Component`, o una función simple para componentes sin estado.
El componente puede ser proporcionado como una cadena, como una subclase de `React.Component` o una función simple para componentes sin estado.


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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Si te cansas de escribir tanto `React.createElement`, un patrón común es assignarlo a una variable corta:
Si te cansas de escribir tanto `React.createElement`, un patrón común es asignarlo a una variable corta:


Alternativamente, puedes referefirte 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 terser.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Alternativamente, puedes referefirte 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 terser.
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.

@carburo
Copy link
Member

carburo commented Feb 7, 2019

Ok, we are good. Thank you!
Merging 🚀

@carburo carburo merged commit 642d4c9 into reactjs:master Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants