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
It will produce non-interactive HTML output of your React components.
31
+
Ele produzirá saída HTML não interativa de seus componentes React.
32
32
33
-
[See more examples below.](#usage)
33
+
[Veja mais exemplos abaixo.](#usage)
34
34
35
-
#### Parameters {/*parameters*/}
35
+
#### Parâmetros {/*parameters*/}
36
36
37
-
* `reactNode`: A React node you want to render to HTML. For example, a JSX node like`<Page />`.
38
-
* **optional** `options`: An object for server render.
39
-
* **optional** `identifierPrefix`: A string prefix React uses for IDs generated by [`useId`.](/reference/react/useId) Useful to avoid conflicts when using multiple roots on the same page.
37
+
* `reactNode`: Um nó React que você deseja renderizar em HTML. Por exemplo, um nó JSX como`<Page />`.
38
+
* **opcional** `options`: Um objeto para renderização no servidor.
39
+
* **opcional** `identifierPrefix`: Um prefixo de string que o React usa para IDs gerados por [`useId`.](/reference/react/useId) Útil para evitar conflitos ao usar vários roots na mesma página.
40
40
41
-
#### Returns {/*returns*/}
41
+
#### Retorna {/*returns*/}
42
42
43
-
An HTML string.
43
+
Uma string HTML.
44
44
45
-
#### Caveats {/*caveats*/}
45
+
#### Ressalvas {/*caveats*/}
46
46
47
-
* `renderToStaticMarkup`output cannot be hydrated.
47
+
* A saída de `renderToStaticMarkup`não pode ser hidratada.
48
48
49
-
* `renderToStaticMarkup`has limited Suspense support. If a component suspends, `renderToStaticMarkup`immediately sends its fallback as HTML.
49
+
* `renderToStaticMarkup`tem suporte limitado para Suspense. Se um componente suspender, `renderToStaticMarkup`envia imediatamente seu fallback como HTML.
50
50
51
-
* `renderToStaticMarkup`works in the browser, but using it in the client code is not recommended. If you need to render a component to HTML in the browser, [get the HTML by rendering it into a DOM node.](/reference/react-dom/server/renderToString#removing-rendertostring-from-the-client-code)
51
+
* `renderToStaticMarkup`funciona no navegador, mas usá-lo no código do cliente não é recomendado. Se você precisar renderizar um componente para HTML no navegador, [obtenha o HTML renderizando-o em um nó DOM.](/reference/react-dom/server/renderToString#removing-rendertostring-from-the-client-code)
52
52
53
53
---
54
54
55
-
## Usage {/*usage*/}
55
+
## Uso {/*usage*/}
56
56
57
-
### Rendering a non-interactive React tree as HTML to a string {/*rendering-a-non-interactive-react-tree-as-html-to-a-string*/}
57
+
### Renderizando uma árvore React não interativa como HTML para uma string {/*rendering-a-non-interactive-react-tree-as-html-to-a-string*/}
58
58
59
-
Call`renderToStaticMarkup`to render your app to an HTML string which you can send with your server response:
59
+
Chame`renderToStaticMarkup`para renderizar seu aplicativo em uma string HTML que você pode enviar com sua resposta do servidor:
//The route handler syntax depends on your backend framework
64
+
//A sintaxe do manipulador de rota depende da sua estrutura de backend
65
65
app.use('/', (request, response) => {
66
66
consthtml=renderToStaticMarkup(<Page />);
67
67
response.send(html);
68
68
});
69
69
```
70
70
71
-
This will produce the initial non-interactive HTML output of your React components.
71
+
Isso produzirá a saída HTML inicial não interativa de seus componentes React.
72
72
73
73
<Pitfall>
74
74
75
-
This method renders **non-interactive HTML that cannot be hydrated.** This is useful if you want to use React as a simple static page generator, or if you're rendering completely static content like emails.
75
+
Este método renderiza **HTML não interativo que não pode ser hidratado.** Isso é útil se você deseja usar React como um gerador de página estática simples, ou se estiver renderizando conteúdo completamente estático, como e-mails.
76
76
77
-
Interactive apps should use [`renderToString`](/reference/react-dom/server/renderToString) on the server and [`hydrateRoot`](/reference/react-dom/client/hydrateRoot) on the client.
77
+
Aplicativos interativos devem usar [`renderToString`](/reference/react-dom/server/renderToString) no servidor e [`hydrateRoot`](/reference/react-dom/client/hydrateRoot) no cliente.
0 commit comments