From 0fd5aac92caec2968efd9f0d313b85c2b52d398a Mon Sep 17 00:00:00 2001 From: Eric Murta Date: Sun, 17 Feb 2019 21:33:46 -0300 Subject: [PATCH 1/6] Translate jsx-in-depth to pt-BR --- content/docs/jsx-in-depth.md | 172 +++++++++++++++++------------------ 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/content/docs/jsx-in-depth.md b/content/docs/jsx-in-depth.md index 3dcf2ac26..60cca9dc1 100644 --- a/content/docs/jsx-in-depth.md +++ b/content/docs/jsx-in-depth.md @@ -13,31 +13,31 @@ redirect_from: - "docs/jsx-in-depth-ko-KR.html" --- -Fundamentally, JSX just provides syntactic sugar for the `React.createElement(component, props, ...children)` function. The JSX code: +Fundamentalmente, JSX é somente um syntatic sugar para a função `React.createElement(component, props, ...children)`. O código JSX: ```js - Click Me + Clique aqui ``` -compiles into: +é compilado para: ```js React.createElement( MyButton, {color: 'blue', shadowSize: 2}, - 'Click Me' + 'Clique aqui' ) ``` -You can also use the self-closing form of the tag if there are no children. So: +Você também pode fechar a tag imediatamente se não tiver elementos filhos. Então: ```js
``` -compiles into: +é compilado para: ```js React.createElement( @@ -47,19 +47,19 @@ React.createElement( ) ``` -If you want to test out how some specific JSX is converted into JavaScript, you can try out [the online Babel compiler](babel://jsx-simple-example). +Se você quer testar como um JSX em específico é convertido em JavaScript você pode user [o compliador online do Babel](babel://jsx-simple-example). -## Specifying The React Element Type {#specifying-the-react-element-type} +## Especificando o Tipo do Elemento React {#specifying-the-react-element-type} -The first part of a JSX tag determines the type of the React element. +A primeira parte de uma tag JSX determina o tipo do elemento React. -Capitalized types indicate that the JSX tag is referring to a React component. These tags get compiled into a direct reference to the named variable, so if you use the JSX `` expression, `Foo` must be in scope. +Tipos começando com letra maiúscula se referem a um componente React. Essas tags são compiladas para uma referência direta da variável nomeada, então se você usar a expressão JSX ``, `Foo` tem que estar no escopo. -### React Must Be in Scope {#react-must-be-in-scope} +### React Tem Que Estar no Escopo{#react-must-be-in-scope} -Since JSX compiles into calls to `React.createElement`, the `React` library must also always be in scope from your JSX code. +Já que JSX compila para chamadas para `React.createElement`, a biblioteca `React` também tem sempre que estar no escopo do seu código JSX. -For example, both of the imports are necessary in this code, even though `React` and `CustomButton` are not directly referenced from JavaScript: +Por exemplo, os dois imports são necessários nesse código, apesar de que `React` e `CustomButton` não são referenciados diretamente pelo JavaScript: ```js{1,2,5} import React from 'react'; @@ -71,69 +71,69 @@ function WarningButton() { } ``` -If you don't use a JavaScript bundler and loaded React from a `