Skip to content

Commit 4d7484f

Browse files
fjoshuajrcezaraugusto
authored andcommitted
ReactDOMServer page (#10)
1 parent cfc1f27 commit 4d7484f

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

content/docs/reference-react-dom-server.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,40 @@ category: Reference
66
permalink: docs/react-dom-server.html
77
---
88

9-
The `ReactDOMServer` object enables you to render components to static markup. Typically, it's used on a Node server:
9+
O objeto `ReactDOMServer` permite que você renderize componentes para markup estático. Normalmente, é usado em um servidor Node:
1010

1111
```js
12-
// ES modules
12+
// Módulos ES
1313
import ReactDOMServer from 'react-dom/server';
1414
// CommonJS
1515
var ReactDOMServer = require('react-dom/server');
1616
```
1717

18-
## Overview {#overview}
18+
## Visão Geral {#visao-geral}
1919

20-
The following methods can be used in both the server and browser environments:
20+
Os métodos a seguir podem ser usados tanto em ambiente de servidor como de navegador:
2121

2222
- [`renderToString()`](#rendertostring)
2323
- [`renderToStaticMarkup()`](#rendertostaticmarkup)
2424

25-
These additional methods depend on a package (`stream`) that is **only available on the server**, and won't work in the browser.
25+
Estes métodos adicionais dependem do pacote (`stream`) que **só está disponível no servidor**, e não irão funcionar no navegador.
2626

2727
- [`renderToNodeStream()`](#rendertonodestream)
2828
- [`renderToStaticNodeStream()`](#rendertostaticnodestream)
2929

3030
* * *
3131

32-
## Reference {#reference}
32+
## Referência {#referencia}
3333

3434
### `renderToString()` {#rendertostring}
3535

3636
```javascript
3737
ReactDOMServer.renderToString(element)
3838
```
3939

40-
Render a React element to its initial HTML. React will return an HTML string. You can use this method to generate HTML on the server and send the markup down on the initial request for faster page loads and to allow search engines to crawl your pages for SEO purposes.
40+
Renderiza um elemento React para o seu HTML inicial. O React retornará uma string HTML. Você pode usar este método para gerar HTML no servidor e enviar o markup no request inicial para ter carregamentos de páginas mais rápidos e para permitir que motores de pesquisa rastreiem suas páginas para fins de SEO.
4141

42-
If you call [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) on a node that already has this server-rendered markup, React will preserve it and only attach event handlers, allowing you to have a very performant first-load experience.
42+
Se você invocar [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) em um nó que já tem o seu markup processado pelo servidor, o React vai preservá-lo e apenas atribuir manipuladores de eventos, permitindo que você tenha uma experiência de primeiro carregamento muito eficiente.
4343

4444
* * *
4545

@@ -49,9 +49,9 @@ If you call [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) on a node that
4949
ReactDOMServer.renderToStaticMarkup(element)
5050
```
5151

52-
Similar to [`renderToString`](#rendertostring), except this doesn't create extra DOM attributes that React uses internally, such as `data-reactroot`. This is useful if you want to use React as a simple static page generator, as stripping away the extra attributes can save some bytes.
52+
Semelhante a [`renderToString`](#rendertostring), exceto que este não cria atributos DOM extras que o React usa internamente, como `data-reactroot`. Isso é útil se você quiser usar o React como um simples gerador de páginas estáticas, já que remover os atributos extras pode economizar alguns bytes.
5353

54-
If you plan to use React on the client to make the markup interactive, do not use this method. Instead, use [`renderToString`](#rendertostring) on the server and [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) on the client.
54+
Se você planeja usar o React no cliente para tornar o markup interativo, não use este método. Em vez disso, use [`renderToString`](#rendertostring) no servidor e [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) no cliente.
5555

5656
* * *
5757

@@ -61,15 +61,15 @@ If you plan to use React on the client to make the markup interactive, do not us
6161
ReactDOMServer.renderToNodeStream(element)
6262
```
6363

64-
Render a React element to its initial HTML. Returns a [Readable stream](https://nodejs.org/api/stream.html#stream_readable_streams) that outputs an HTML string. The HTML output by this stream is exactly equal to what [`ReactDOMServer.renderToString`](#rendertostring) would return. You can use this method to generate HTML on the server and send the markup down on the initial request for faster page loads and to allow search engines to crawl your pages for SEO purposes.
64+
Renderiza um elemento React para seu HTML inicial. Retorna um [Stream legível](https://nodejs.org/api/stream.html#stream_readable_streams) que gera uma string HTML. A saída HTML desse stream é exatamente igual ao que [`ReactDOMServer.renderToString`](#rendertostring) retornaria. Você pode usar este método para gerar HTML no servidor e enviar o markup no request inicial para ter carregamentos de página mais rápidos e para permitir que motores de pesquisa rastreiem suas páginas para fins de SEO.
6565

66-
If you call [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) on a node that already has this server-rendered markup, React will preserve it and only attach event handlers, allowing you to have a very performant first-load experience.
66+
Se você invocar [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) em um nó que já tem o seu markup processado pelo servidor, React vai preservá-lo e apenas atribuir manipuladores de eventos, permitindo que você tenha uma experiência de primeiro carregamento muito eficiente.
6767

68-
> Note:
68+
> Nota:
6969
>
70-
> Server-only. This API is not available in the browser.
70+
> Apenas para servidor. Esta API não está disponível no navegador.
7171
>
72-
> The stream returned from this method will return a byte stream encoded in utf-8. If you need a stream in another encoding, take a look at a project like [iconv-lite](https://www.npmjs.com/package/iconv-lite), which provides transform streams for transcoding text.
72+
> O stream retornado deste método retornará um stream de bytes codificado em utf-8. Se você precisar de um stream em outra codificação, dê uma olhada em um projeto como o [iconv-lite](https://www.npmjs.com/package/iconv-lite), que fornece streams de transformação para transcodificação de texto.
7373
7474
* * *
7575

@@ -79,14 +79,14 @@ If you call [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) on a node that
7979
ReactDOMServer.renderToStaticNodeStream(element)
8080
```
8181

82-
Similar to [`renderToNodeStream`](#rendertonodestream), except this doesn't create extra DOM attributes that React uses internally, such as `data-reactroot`. This is useful if you want to use React as a simple static page generator, as stripping away the extra attributes can save some bytes.
82+
Semelhante a [`renderToNodeStream`](#rendertonodestream), exceto que este não cria atributos DOM extras que o React usa internamente, como `data-reactroot`. Isso é útil se você quiser usar o React como um simples gerador de páginas estáticas, já que remover os atributos extras pode economizar alguns bytes.
8383

84-
The HTML output by this stream is exactly equal to what [`ReactDOMServer.renderToStaticMarkup`](#rendertostaticmarkup) would return.
84+
A saída HTML desse stream é exatamente igual ao que [`ReactDOMServer.renderToStaticMarkup`](#rendertostaticmarkup) retornaria.
8585

86-
If you plan to use React on the client to make the markup interactive, do not use this method. Instead, use [`renderToNodeStream`](#rendertonodestream) on the server and [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) on the client.
86+
Se você planeja usar o React no cliente para tornar o markup interativo, não use este método. Em vez disso, use [`renderToNodeStream`](#rendertonodestream) no servidor e [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) no cliente.
8787

88-
> Note:
88+
> Nota:
8989
>
90-
> Server-only. This API is not available in the browser.
90+
> Apenas para servidor. Esta API não está disponível no navegador.
9191
>
92-
> The stream returned from this method will return a byte stream encoded in utf-8. If you need a stream in another encoding, take a look at a project like [iconv-lite](https://www.npmjs.com/package/iconv-lite), which provides transform streams for transcoding text.
92+
> O stream retornado deste método retornará um stream de bytes codificado em utf-8. Se você precisar de um stream em outra codificação, dê uma olhada em um projeto como o [iconv-lite](https://www.npmjs.com/package/iconv-lite), que fornece streams de transformação para transcodificação de texto.

0 commit comments

Comments
 (0)