Skip to content

Commit d4b5377

Browse files
authored
translating pages/reference/render.md to pt-br (#578)
* translating pages/reference/render.md to pt-br * nomes de componentes/atributos/props em inglês * reordering render.md to pages/apis * updated render.md translation
1 parent ec82d5e commit d4b5377

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

beta/src/pages/apis/render.md

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@ title: render
44

55
<Intro>
66

7-
`render` renders a piece of [JSX](/learn/writing-markup-with-jsx) ("React node") into a browser DOM node.
7+
`render` renderiza um pedaço de [JSX](/learn/writing-markup-with-jsx) ("nó React") em um nó do DOM do navegador.
88

99
```js
1010
render(reactNode, domNode, callback?)
1111
```
1212
1313
</Intro>
1414
15-
- [Usage](#usage)
16-
- [Rendering the root component](#rendering-the-root-component)
17-
- [Rendering multiple roots](#rendering-multiple-roots)
18-
- [Updating the rendered tree](#updating-the-rendered-tree)
19-
- [Reference](#reference)
15+
- [Uso](#usage)
16+
- [Renderizando o componente raiz](#rendering-the-root-component)
17+
- [Renderizando várias raízes](#rendering-multiple-roots)
18+
- [Atualizando a árvore renderizada](#updating-the-rendered-tree)
19+
- [Referência](#reference)
2020
- [`render(reactNode, domNode, callback?)`](#render)
2121
2222
---
2323
24-
## Usage {/*usage*/}
24+
## Uso {/*usage*/}
2525
26-
Call `render` to display a <CodeStep step={1}>React component</CodeStep> inside a <CodeStep step={2}>browser DOM node</CodeStep>.
26+
Chame `render` para exibir um <CodeStep step={1}>componente React</CodeStep> dentro de um <CodeStep step={2}>nó do DOM do navegador</CodeStep>.
2727
2828
```js [[1, 4, "<App />"], [2, 4, "document.getElementById('root')"]]
2929
import {render} from 'react-dom';
@@ -32,9 +32,9 @@ import App from './App.js';
3232
render(<App />, document.getElementById('root'));
3333
````
3434

35-
### Rendering the root component {/*rendering-the-root-component*/}
35+
### Renderizando o componente raiz {/*rendering-the-root-component*/}
3636

37-
In apps fully built with React, **you will usually only do this once at startup**--to render the "root" component.
37+
Em aplicativos totalmente construídos com React, **você normalmente só fará isso uma vez na inicialização** -- para renderizar o componente "raiz".
3838

3939
<Sandpack>
4040

@@ -48,26 +48,26 @@ render(<App />, document.getElementById('root'));
4848

4949
```js App.js
5050
export default function App() {
51-
return <h1>Hello, world!</h1>;
51+
return <h1>Olá, mundo!</h1>;
5252
}
5353
```
5454

5555
</Sandpack>
5656

57-
Usually you shouldn't need to call `render` again or to call it in more places. From this point on, React will be managing the DOM of your application. If you want to update the UI, your components can do this by [using state](/apis/usestate).
57+
Normalmente você não precisa chamar `render` novamente ou chamá-lo em mais lugares. A partir deste ponto, o React estará gerenciando o DOM de sua aplicação. Se você deseja atualizar a interface do usuário, seus componentes podem fazer isso [usando o estado](/apis/usestate).
5858

5959
---
6060

61-
### Rendering multiple roots {/*rendering-multiple-roots*/}
61+
### Renderizando várias raízes {/*rendering-multiple-roots*/}
6262

63-
If your page [isn't fully built with React](/learn/add-react-to-a-website), call `render` for each top-level piece of UI managed by React.
63+
Se sua página [não for totalmente construída com React](/learn/add-react-to-a-website), chame `render` para cada parte da interface de usuário de nível superior gerenciada pelo React.
6464

6565
<Sandpack>
6666

6767
```html public/index.html
6868
<nav id="navigation"></nav>
6969
<main>
70-
<p>This paragraph is not rendered by React (open index.html to verify).</p>
70+
<p>Este parágrafo não é renderizado pelo React (abra index.html para verificar).</p>
7171
<section id="comments"></section>
7272
</main>
7373
```
@@ -93,7 +93,7 @@ export function Navigation() {
9393
return (
9494
<ul>
9595
<NavLink href="/">Home</NavLink>
96-
<NavLink href="/about">About</NavLink>
96+
<NavLink href="/about">Sobre</NavLink>
9797
</ul>
9898
);
9999
}
@@ -109,9 +109,9 @@ function NavLink({ href, children }) {
109109
export function Comments() {
110110
return (
111111
<>
112-
<h2>Comments</h2>
113-
<Comment text="Hello!" author="Sophie" />
114-
<Comment text="How are you?" author="Sunil" />
112+
<h2>Comentários</h2>
113+
<Comment text="Olá!" author="Sophie" />
114+
<Comment text="Como vai você?" author="Sunil" />
115115
</>
116116
);
117117
}
@@ -130,13 +130,13 @@ nav ul li { display: inline-block; margin-right: 20px; }
130130

131131
</Sandpack>
132132

133-
You can destroy the rendered trees with [`unmountComponentAtNode()`](TODO).
133+
Você pode destruir as árvores renderizadas com [`unmountComponentAtNode()`](TODO).
134134

135135
---
136136

137-
### Updating the rendered tree {/*updating-the-rendered-tree*/}
137+
### Atualizando a árvore renderizada {/*updating-the-rendered-tree*/}
138138

139-
You can call `render` more than once on the same DOM node. As long as the component tree structure matches up with what was previously rendered, React will [preserve the state](/learn/preserving-and-resetting-state). Notice how you can type in the input, which means that the updates from repeated `render` calls every second in this example are not destructive:
139+
Você pode chamar `render` mais de uma vez no mesmo nó do DOM. Contanto que a estrutura da árvore de componentes corresponda ao que foi renderizado anteriormente, o React [preservará o estado](/learn/preserving-and-resetting-state). Observe como você pode digitar a entrada, o que significa que as atualizações de chamadas `render` repetidas a cada segundo neste exemplo não são destrutivas:
140140

141141
<Sandpack>
142142

@@ -159,55 +159,55 @@ setInterval(() => {
159159
export default function App({counter}) {
160160
return (
161161
<>
162-
<h1>Hello, world! {counter}</h1>
163-
<input placeholder="Type something here" />
162+
<h1>Olá mundo! {counter}</h1>
163+
<input placeholder="Digite algo aqui" />
164164
</>
165165
);
166166
}
167167
```
168168

169169
</Sandpack>
170170

171-
It is uncommon to call `render` multiple times. Usually, you'll [update state](/apis/usestate) inside one of the components instead.
171+
É incomum chamar `render` várias vezes. Normalmente, você [atualiza o estado](/apis/usestate) dentro de um dos componentes.
172172

173173
---
174174

175-
## Reference {/*reference*/}
175+
## Referência {/*reference*/}
176176

177177
### `render(reactNode, domNode, callback?)` {/*render*/}
178178

179-
Call `render` to display a React component inside a browser DOM element.
179+
Chame `render` para exibir um componente React dentro de um elemento DOM do navegador.
180180

181181
```js
182182
const domNode = document.getElementById('root');
183183
render(<App />, domNode);
184184
```
185185

186-
React will display `<App />` in the `domNode`, and take over managing the DOM inside it.
186+
O React exibirá `<App />` no `domNode` e assumirá o gerenciamento do DOM dentro dele.
187187

188-
An app fully built with React will usually only have one `render` call with its root component. A page that uses "sprinkles" of React for parts of the page may have as many `render` calls as needed.
188+
Um aplicativo totalmente construído com React geralmente terá apenas uma chamada `render` com seu componente raiz. Uma página que usa "pedaços" de React para partes da página pode ter quantas chamadas `render` quantas forem necessárias.
189189

190-
[See examples above.](#usage)
190+
[Veja exemplos acima.](#usage)
191191

192-
#### Parameters {/*parameters*/}
192+
#### Parâmetros {/*parameters*/}
193193

194-
* `reactNode`: A *React node* that you want to display. This will usually be a piece of JSX like `<App />`, but you can also pass a React element constructed with [`createElement()`](/TODO), a string, a number, `null`, or `undefined`.
194+
* `reactNode`: Um *nó React* que você deseja exibir. Isso geralmente será um pedaço de JSX como `<App />`, mas você também pode passar um elemento React construído com [`createElement()`](/TODO), uma string, um número, `null` ou `undefined`.
195195

196-
* `domNode`: A [DOM element](https://developer.mozilla.org/en-US/docs/Web/API/Element). React will display the `reactNode` you pass inside this DOM element. From this moment, React will manage the DOM inside the `domNode` and update it when your React tree changes.
196+
* `domNode`: Um [elemento DOM](https://developer.mozilla.org/en-US/docs/Web/API/Element). O React exibirá o `reactNode` que você passar dentro deste elemento DOM. A partir deste momento, o React irá gerenciar o DOM dentro do `domNode` e atualizá-lo quando sua árvore do React mudar.
197197

198-
* **optional** `callback`: A function. If passed, React will call it after your component is placed into the DOM.
198+
* **opcional** `callback`: Uma função. Se aprovado, o React irá chamá-lo depois que seu componente for colocado no DOM.
199199

200200

201-
#### Returns {/*returns*/}
201+
#### Retornos {/*returns*/}
202202

203-
`render` usually returns `null`. However, if the `reactNode` you pass is a *class component*, then it will return an instance of that component.
203+
`render` geralmente retorna `null`. No entanto, se o `reactNode` que você passar for um *componente de classe*, ele retornará uma instância desse componente.
204204

205-
#### Caveats {/*caveats*/}
205+
#### Ressalvas {/*caveats*/}
206206

207-
* The first time you call `render`, React will clear all the existing HTML content inside the `domNode` before rendering the React component into it. If your `domNode` contains HTML generated by React on the server or during the build, use [`hydrate()`](/TODO) instead, which attaches the event handlers to the existing HTML.
207+
* A primeira vez que você chamar `render`, o React irá limpar todo o conteúdo HTML existente dentro do `domNode` antes de renderizar o componente React nele. Se o seu `domNode` contém HTML gerado pelo React no servidor ou durante a compilação, use [`hydrate()`](/TODO), que anexa os manipuladores de eventos ao HTML existente.
208208

209-
* If you call `render` on the same `domNode` more than once, React will update the DOM as necessary to reflect the latest JSX you passed. React will decide which parts of the DOM can be reused and which need to be recreated by ["matching it up"](/learn/preserving-and-resetting-state) with the previously rendered tree. Calling `render` on the same `domNode` again is similar to calling the [`set` function](/apis/usestate#setstate) on the root component: React avoids unnecessary DOM updates.
209+
* Se você chamar `render` no mesmo `domNode` mais de uma vez, o React irá atualizar o DOM conforme necessário para refletir o último JSX que você passou. O React decidirá quais partes do DOM podem ser reutilizadas e quais precisam ser recriadas ["combinando"](/learn/preserving-and-resetting-state) com a árvore renderizada anteriormente. Chamar `render` no mesmo `domNode` novamente é semelhante a chamar a função [`set`](/apis/usestate#setstate) no componente raiz: React evita atualizações desnecessárias do DOM.
210210

211-
* If your app is fully built with React, you'll likely have only one `render` call in your app. (If you use a framework, it might do this call for you.) When you want to render a piece of JSX in a different part of the DOM tree that isn't a child of your component (for example, a modal or a tooltip), use [`createPortal`](TODO) instead of `render`.
211+
* Se seu aplicativo for totalmente construído com React, você provavelmente terá apenas uma chamada `render` em seu aplicativo. (Se você usa um framework, ele pode fazer essa chamada para você.) Quando você deseja renderizar uma parte do JSX em uma parte diferente da árvore DOM que não é filho do seu componente (por exemplo, um modal ou um dica de ferramenta), use [`createPortal`](TODO) em vez de `render`.
212212

213213
---

0 commit comments

Comments
 (0)