You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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 DOMde sua aplicação. Se você deseja atualizar a interfacedo usuário, seus componentes podem fazer isso [usando o estado](/apis/usestate).
### Renderizando várias raízes {/*rendering-multiple-roots*/}
62
62
63
-
If your page [isn't fully built withReact](/learn/add-react-to-a-website), call`render`for each top-level piece ofUI 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.
64
64
65
65
<Sandpack>
66
66
67
67
```html public/index.html
68
68
<nav id="navigation"></nav>
69
69
<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>
71
71
<section id="comments"></section>
72
72
</main>
73
73
```
@@ -93,7 +93,7 @@ export function Navigation() {
93
93
return (
94
94
<ul>
95
95
<NavLink href="/">Home</NavLink>
96
-
<NavLink href="/about">About</NavLink>
96
+
<NavLink href="/about">Sobre</NavLink>
97
97
</ul>
98
98
);
99
99
}
@@ -109,9 +109,9 @@ function NavLink({ href, children }) {
109
109
export function Comments() {
110
110
return (
111
111
<>
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" />
115
115
</>
116
116
);
117
117
}
@@ -130,13 +130,13 @@ nav ul li { display: inline-block; margin-right: 20px; }
130
130
131
131
</Sandpack>
132
132
133
-
You can destroy the rendered trees with [`unmountComponentAtNode()`](TODO).
133
+
Você pode destruir as árvores renderizadas com [`unmountComponentAtNode()`](TODO).
134
134
135
135
---
136
136
137
-
### Updating the rendered tree {/*updating-the-rendered-tree*/}
137
+
### Atualizando a árvore renderizada {/*updating-the-rendered-tree*/}
138
138
139
-
You can call`render`more than once on the same DOMnode. 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 inthis example are not destructive:
139
+
Você pode chamar`render`mais de uma vez no mesmo nó doDOM. 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:
140
140
141
141
<Sandpack>
142
142
@@ -159,55 +159,55 @@ setInterval(() => {
159
159
export default function App({counter}) {
160
160
return (
161
161
<>
162
-
<h1>Hello, world! {counter}</h1>
163
-
<input placeholder="Type something here" />
162
+
<h1>Olá mundo! {counter}</h1>
163
+
<input placeholder="Digite algo aqui" />
164
164
</>
165
165
);
166
166
}
167
167
```
168
168
169
169
</Sandpack>
170
170
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.
Call `render` to display a React component inside a browser DOM element.
179
+
Chame`render`para exibir um componente React dentro de um elementoDOMdo navegador.
180
180
181
181
```js
182
182
const domNode = document.getElementById('root');
183
183
render(<App />, domNode);
184
184
```
185
185
186
-
React will display `<App />` in the `domNode`, and take over managing the DOM inside it.
186
+
OReact exibirá `<App />`no `domNode` e assumirá o gerenciamento doDOMdentro dele.
187
187
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.
189
189
190
-
[See examples above.](#usage)
190
+
[Veja exemplos acima.](#usage)
191
191
192
-
#### Parameters {/*parameters*/}
192
+
#### Parâmetros {/*parameters*/}
193
193
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 JSXcomo`<App />`, mas você também pode passar um elemento React construído com [`createElement()`](/TODO), uma string, um número, `null` ou`undefined`.
195
195
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.
197
197
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 noDOM.
199
199
200
200
201
-
#### Returns {/*returns*/}
201
+
#### Retornos {/*returns*/}
202
202
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.
204
204
205
-
#### Caveats {/*caveats*/}
205
+
#### Ressalvas {/*caveats*/}
206
206
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údoHTMLexistente dentro do`domNode`antes de renderizar o componente React nele. Se o seu `domNode`contémHTMLgerado pelo React no servidor ou durante a compilação, use [`hydrate()`](/TODO), que anexa os manipuladores de eventos ao HTML existente.
208
208
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 oDOMconforme necessário para refletir o últimoJSXque você passou. OReact decidirá quais partes doDOMpodem 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 doDOM.
210
210
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 dothis call for you.) When you want to render a piece ofJSXin a different part of theDOMtree 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 doJSXem uma parte diferente da árvoreDOMque não é filho do seu componente (por exemplo, um modal ou um dica de ferramenta), use [`createPortal`](TODO) em vez de`render`.
0 commit comments