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
+
Esto producirá una salida de HTML no interactiva de tus componentes de React.
32
32
33
-
[See more examples below.](#usage)
33
+
[Ver más ejemplos abajo.](#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 />`.
37
+
*`reactNode`: Un nodo React que deseas renderizar a HTML. Por ejemplo, un nodo JSX como`<Page />`.
38
38
39
-
#### Returns {/*returns*/}
39
+
#### Devuelve {/*returns*/}
40
40
41
-
An HTML string.
41
+
Un _string_ de HTML.
42
42
43
-
#### Caveats {/*caveats*/}
43
+
#### Advertencias {/*caveats*/}
44
44
45
-
*`renderToStaticMarkup`output cannot be hydrated.
45
+
*La salida de `renderToStaticMarkup`no puede ser hidratada.
46
46
47
-
*`renderToStaticMarkup`has limited Suspense support. If a component suspends, `renderToStaticMarkup`immediately sends its fallback as HTML.
47
+
*`renderToStaticMarkup`tiene un soporte limitado para _Suspense_. Si un componente se suspende, `renderToStaticMarkup`inmediatamente envía su _fallback_ como HTML.
48
48
49
-
*`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)
49
+
*`renderToStaticMarkup`funciona en el navegador, pero usarlo en el código del cliente no es recomendable. Si necesitas renderizar un componente a HTML en el navegador, [obtén el HTML renderizándolo en un nodo DOM.](/reference/react-dom/server/renderToString#removing-rendertostring-from-the-client-code)
50
50
51
51
---
52
52
53
-
## Usage {/*usage*/}
53
+
## Uso {/*usage*/}
54
54
55
-
### Rendering a non-interactive React tree as HTML to a string {/*rendering-a-non-interactive-react-tree-as-html-to-a-string*/}
55
+
### Renderizar un árbol React no interactivo como HTML en un _string_ {/*rendering-a-non-interactive-react-tree-as-html-to-a-string*/}
56
56
57
-
Call `renderToStaticMarkup`to render your app to an HTML string which you can send with your server response:
57
+
Llama a `renderToStaticMarkup`para renderizar tu aplicación a un _string_ de HTML que puedas enviar con la respuesta del servidor:
//The route handler syntax depends on your backend framework
62
+
//La sintaxis del manejador de rutas depende de tu framework de backend
63
63
app.use('/', (request, response) => {
64
64
consthtml=renderToStaticMarkup(<Page />);
65
65
response.send(html);
66
66
});
67
67
```
68
68
69
-
This will produce the initial non-interactive HTML output of your React components.
69
+
Esto producirá la salida inicial de HTML no interactiva de tus componentes de React.
70
70
71
71
<Pitfall>
72
72
73
-
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.
73
+
Este método renderiza**HTML no interactivo que no puede ser hidratado.**Esto es útil si deseas usar React como un generador de páginas estáticas simple, o si estás renderizando contenido completamente estático, como correos electrónicos.
74
74
75
-
Interactive apps should use [`renderToString`](/reference/react-dom/server/renderToString)on the server and[`hydrateRoot`](/reference/react-dom/client/hydrateRoot)on the client.
75
+
Las aplicaciones interactivas deben usar [`renderToString`](/reference/react-dom/server/renderToString)en el servidor y[`hydrateRoot`](/reference/react-dom/client/hydrateRoot)en el cliente.
0 commit comments