-
Notifications
You must be signed in to change notification settings - Fork 302
translate fragment (beta docs) #564
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,10 +1,10 @@ | ||||||
| --- | ||||||
| title: Fragment (<>...</>) | ||||||
| title: Fragmento (<>...</>) | ||||||
| --- | ||||||
|
|
||||||
| <Intro> | ||||||
|
|
||||||
| The `Fragment` component, which is often used via the `<>...</>` syntax, lets you render multiple elements in place of one, without wrapping them in any other container element. | ||||||
| El componente `Fragment`, que es usualmente usado atraves de la sintaxis `<>...</>`, te permite renderizar múltiples elementos en lugar de uno, sin tener que envolverlos dentro de otro elemento contenedor. | ||||||
|
|
||||||
| ```js | ||||||
| <> | ||||||
|
|
@@ -19,11 +19,11 @@ The `Fragment` component, which is often used via the `<>...</>` syntax, lets yo | |||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Usage {/*usage*/} | ||||||
| ## Uso {/*usage*/} | ||||||
|
|
||||||
| ### Returning multiple elements {/*returning-multiple-elements*/} | ||||||
| ### Retornando múltiples elementos {/*returning-multiple-elements*/} | ||||||
Vicenciomf1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| Use `Fragment`, or the equivalent `<>...</>` syntax, to group multiple elements together. You can use it to put multiple elements in any place where a single element can go. For example, a component can only return one element, but by using a Fragment you can group multiple elements together and then return them as a group: | ||||||
| Usa `Fragment`, o la sintaxis equivalente `<>...</>`, para agrupar múltiples elementos. Puedes usarlo para poner múltiples elementos en cualquier lugar donde un solo elemento puede ir. Por ejemplo, un componente solo puede retornar un elemento, pero usando un Fragmento puedes agrupar múltiples elementos y retornarlos como un grupo: | ||||||
|
|
||||||
| ```js {3,6} | ||||||
| function Post() { | ||||||
|
|
@@ -36,7 +36,7 @@ function Post() { | |||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| Fragments are useful because grouping elements with a Fragment has no effect on layout or styles, unlike if you wrapped the elements in some other container such as a DOM element. If you inspect this example with the browser tools, you'll see that all `<h1>` and `<p>` DOM nodes appear as siblings without wrappers around them: | ||||||
| Los Fragmentos son útiles por que al agrupar varios elementos con un Fragmento no tiene efecto en el diseño o los estilos, a diferencia de si tu envolviste los elementos dentro de cualquier otro contenedor tal como un elemento del DOM. Si tu inspeccionas este ejemplo con las herramientas del navegador, verás que todos los nodos del DOM `<h1>` y `<p>` aparecen como hermanos sin envoltorios alrededor de ellos: | ||||||
Vicenciomf1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| <Sandpack> | ||||||
|
|
||||||
|
|
@@ -74,9 +74,9 @@ function PostBody({ body }) { | |||||
|
|
||||||
| </Sandpack> | ||||||
|
|
||||||
| <DeepDive title="How to write a Fragment without the special syntax?"> | ||||||
| <DeepDive title="¿Como escribir un fragmento sin la sintaxis especial?"> | ||||||
|
|
||||||
| The example above is equivalent to importing `Fragment` from React: | ||||||
| El ejemplo anterior es equivalente a importar `Fragment` de React: | ||||||
|
|
||||||
| ```js {1,5,8} | ||||||
| import { Fragment } from 'react'; | ||||||
|
|
@@ -91,15 +91,15 @@ function Post() { | |||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| Usually you won't need this unless you need to [pass a `key` to your `Fragment`.](#rendering-a-list-of-fragments) | ||||||
| Usualmente no necesitarás esto a menos que necesites [pasar una `key` a tu `Fragment`.](#rendering-a-list-of-fragments) | ||||||
|
|
||||||
| </DeepDive> | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ### Assigning multiple elements to a variable {/*assigning-multiple-elements-to-a-variable*/} | ||||||
| ### Asignando múltiples elementos a una variable {/*assigning-multiple-elements-to-a-variable*/} | ||||||
Vicenciomf1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| Like any other element, you can assign Fragment elements to variables, pass them as props, and so on: | ||||||
| Como cualquier otro elemento, puedes asignar Fragmentos a variables, pasarlos como props, y así sucesivamente: | ||||||
|
|
||||||
| ```js | ||||||
| function CloseDialog() { | ||||||
|
|
@@ -119,9 +119,9 @@ function CloseDialog() { | |||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ### Grouping elements with text {/*grouping-elements-with-text*/} | ||||||
| ### Agrupando elementos con texto {/*grouping-elements-with-text*/} | ||||||
Vicenciomf1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| You can use `Fragment` to group text together with components: | ||||||
| Puedes usar `Fragment` para agrupar texto con componentes: | ||||||
|
|
||||||
| ```js | ||||||
| function DateRangePicker({ start, end }) { | ||||||
|
|
@@ -138,9 +138,9 @@ function DateRangePicker({ start, end }) { | |||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ### Rendering a list of Fragments {/*rendering-a-list-of-fragments*/} | ||||||
| ### Renderizando una lista de fragmentos {/*rendering-a-list-of-fragments*/} | ||||||
|
||||||
| ### Renderizando una lista de fragmentos {/*rendering-a-list-of-fragments*/} | |
| ### Renderizar una lista de fragmentos {/*rendering-a-list-of-fragments*/} |
La traducción literal del gerundio en los títulos es desaconsejada en la guía de estilos, es recomendado utilizar un infinitivo o un sustantivo (Renderizando->Renderizado de || Renderización de || Renderizar).
Vicenciomf1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Vicenciomf1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Vicenciomf1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Vicenciomf1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Vicenciomf1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Vicenciomf1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Vicenciomf1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Vicenciomf1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Vicenciomf1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Vicenciomf1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.