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
Copy file name to clipboardExpand all lines: src/content/reference/react-dom/server/renderToStaticNodeStream.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: renderToStaticNodeStream
4
4
5
5
<Intro>
6
6
7
-
`renderToStaticNodeStream`renders a non-interactive React tree to a [Node.js Readable Stream.](https://nodejs.org/api/stream.html#readable-streams)
7
+
`renderToStaticNodeStream`renderiza un árbol de React no interactivo a un [Stream legible de Node.js.](https://nodejs.org/api/stream.html#readable-streams)
The stream will produce non-interactive HTML output of your React components.
34
+
El stream producirá, en la salida, HTML no interactivo de tus componentes de React.
35
35
36
-
#### Parameters {/*parameters*/}
36
+
#### Parámetros {/*parameters*/}
37
37
38
-
*`reactNode`: A React node you want to render to HTML. For example, a JSX element like`<Page />`.
38
+
*`reactNode`: Un nodo de React que quieres renderizar a HTML. Por ejemplo, un elemento JSX como`<Page />`.
39
39
40
-
#### Returns {/*returns*/}
40
+
#### Devuelve {/*returns*/}
41
41
42
-
A [Node.js Readable Stream](https://nodejs.org/api/stream.html#readable-streams)that outputs an HTML string. The resulting HTML can't be hydrated on the client.
42
+
Un [Stream legible de Node.js](https://nodejs.org/api/stream.html#readable-streams)que produce un string HTML como salida. El HTML resultante no puede hidratarse en el cliente.
43
43
44
-
#### Caveats {/*caveats*/}
44
+
#### Advertencias {/*caveats*/}
45
45
46
-
*`renderToStaticNodeStream`output cannot be hydrated.
46
+
*La salida de `renderToStaticNodeStream`no puede ser hidratada.
47
47
48
-
*This method will wait for all [Suspense boundaries](/reference/react/Suspense)to complete before returning any output.
48
+
*Este método va a esperar que todas las [barreras de Suspense](/reference/react/Suspense)se completen antes de devolver alguna salida.
49
49
50
-
*As of React 18, this method buffers all of its output, so it doesn't actually provide any streaming benefits.
50
+
*A partir de React 18, este método almacena en búfer toda su salida, por lo que no ofrece realmente ningún beneficio de transmisión.
51
51
52
-
*The returned stream is 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.
52
+
*El stream devuelto es un flujo de bytes codificado en utf-8. Si necesitas un stream en otra codificación, echa un vistazo a un proyecto como [iconv-lite](https://www.npmjs.com/package/iconv-lite), que proporciona streams de transformación para la transcodificación de texto.
53
53
54
54
---
55
55
56
-
## Usage {/*usage*/}
56
+
## Uso {/*usage*/}
57
57
58
-
### Rendering a React tree as static HTML to a Node.js Readable Stream {/*rendering-a-react-tree-as-static-html-to-a-nodejs-readable-stream*/}
58
+
### Renderizar un árbol de React como HTML estático a un Stream legible de Node.js {/*rendering-a-react-tree-as-static-html-to-a-nodejs-readable-stream*/}
59
59
60
-
Call `renderToStaticNodeStream`to get a [Node.js Readable Stream](https://nodejs.org/api/stream.html#readable-streams)which you can pipe to your server response:
60
+
Llama a `renderToStaticNodeStream`para obtener un [Stream legible de Node.js](https://nodejs.org/api/stream.html#readable-streams)que puedes canalizar a la respuesta de tu servidor:
//The route handler syntax depends on your backend framework
65
+
//La sintaxis del manejador de rutas depende del framework de tu backend
66
66
app.use('/', (request, response) => {
67
67
conststream=renderToStaticNodeStream(<Page />);
68
68
stream.pipe(response);
69
69
});
70
70
```
71
71
72
-
The stream will produce the initial non-interactive HTML output of your React components.
72
+
El stream producirá la salida inicial no interactiva de HTML de tus componentes de React.
73
73
74
74
<Pitfall>
75
75
76
-
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.
76
+
Este método renderiza**HTML no interactivo que no se puede hidratar.**Esto es útil si quieres utilizar React como un generador de páginas simple, o si estas renderizando contenido completamente estático como correos electrónicos.
77
77
78
-
Interactive apps should use [`renderToPipeableStream`](/reference/react-dom/server/renderToPipeableStream)on the server and[`hydrateRoot`](/reference/react-dom/client/hydrateRoot)on the client.
78
+
Las aplicaciones interactivas deben usar [`renderToPipeableStream`](/reference/react-dom/server/renderToPipeableStream)en el servidor y[`hydrateRoot`](/reference/react-dom/client/hydrateRoot)en el cliente.
0 commit comments