Skip to content

Commit

Permalink
Merge pull request #473 from arif-ozberk/main
Browse files Browse the repository at this point in the history
translate `renderToStaticNodeStream`
  • Loading branch information
alioguzhan committed Jul 9, 2023
2 parents d73a28d + 58a0fda commit 74c51e5
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/content/reference/react-dom/server/renderToStaticNodeStream.md
Expand Up @@ -4,7 +4,7 @@ title: renderToStaticNodeStream

<Intro>

`renderToStaticNodeStream` renders a non-interactive React tree to a [Node.js Readable Stream.](https://nodejs.org/api/stream.html#readable-streams)
`renderToStaticNodeStream` interaktif olmayan bir React ağacını [Okunabilir Node.js Akışına](https://nodejs.org/api/stream.html#readable-streams) render etmenize olanak tanır.

```js
const stream = renderToStaticNodeStream(reactNode)
Expand All @@ -16,11 +16,11 @@ const stream = renderToStaticNodeStream(reactNode)

---

## Reference {/*reference*/}
## Başvuru dokümanı {/*reference*/}

### `renderToStaticNodeStream(reactNode)` {/*rendertostaticnodestream*/}

On the server, call `renderToStaticNodeStream` to get a [Node.js Readable Stream](https://nodejs.org/api/stream.html#readable-streams).
Sunucuda, [Okunabilir Node.js Akışı](https://nodejs.org/api/stream.html#readable-streams) elde etmek için `renderToStaticNodeStream` fonksiyonunu çağırınız.

```js
import { renderToStaticNodeStream } from 'react-dom/server';
Expand All @@ -29,52 +29,52 @@ const stream = renderToStaticNodeStream(<Page />);
stream.pipe(response);
```

[See more examples below.](#usage)
[Buradan daha fazla örnek görebilirsiniz.](#usage)

The stream will produce non-interactive HTML output of your React components.
Akış, React bileşenlerinizin etkileşimli olmayan HTML çıktılarını üretecektir.

#### Parameters {/*parameters*/}
#### Parametreler {/*parameters*/}

* `reactNode`: A React node you want to render to HTML. For example, a JSX element like `<Page />`.
* `reactNode`: HTML'e render etmek istediğiniz bir React düğümü. Örneğin, `<Sayfa />` gibi bir JSX elemanı.

#### Returns {/*returns*/}
#### Dönüş Değeri {/*returns*/}

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.
HTML string'i döndüren bir [Okunabilir Node.js Akışı](https://nodejs.org/api/stream.html#readable-streams) döndürür. Ortaya çıkan HTML istemcide sulanamaz.

#### Caveats {/*caveats*/}
#### Uyarılar {/*caveats*/}

* `renderToStaticNodeStream` output cannot be hydrated.
* `renderToStaticNodeStream` çıktısı sulanamaz.

* This method will wait for all [Suspense boundaries](/reference/react/Suspense) to complete before returning any output.
* Bu yöntem, herhangi bir çıktı döndürmeden önce tüm [Suspense sınırlarının](/reference/react/Suspense) tamamlanmasını bekler.

* As of React 18, this method buffers all of its output, so it doesn't actually provide any streaming benefits.
* React 18'den itibaren, bu yöntem tüm çıktısını ara belleğe alır, aslında bu nedenle herhangi bir akış avantajı sağlamaz.

* 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.
* Döndürülen akış utf-8 olarak kodlanmış bir byte akışıdır. Başka bir kodlamada akışa ihtiyacınız varsa, metni dönüştürmek için dönüştürme akışları sağlayan [iconv-lite](https://www.npmjs.com/package/iconv-lite) gibi bir projeye göz atabilirsiniz.

---

## Usage {/*usage*/}
## Kullanım {/*usage*/}

### 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*/}
### Bir React ağacını statik HTML olarak Okunabilir Node.js Akışına dönüştürme {/*rendering-a-react-tree-as-static-html-to-a-nodejs-readable-stream*/}

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:
Sunucu yanıtınıza aktarabileceğiniz bir [Okunabilir Node.js Akışı](https://nodejs.org/api/stream.html#readable-streams) elde etmek için `renderToStaticNodeStream` fonksiyonunu çağırabilirsiniz:

```js {5-6}
import { renderToStaticNodeStream } from 'react-dom/server';

// The route handler syntax depends on your backend framework
// Route handler syntax backend çatınıza bağlıdır
app.use('/', (request, response) => {
const stream = renderToStaticNodeStream(<Page />);
stream.pipe(response);
});
```

The stream will produce the initial non-interactive HTML output of your React components.
Akış, React bileşenlerinizin etkileşimli olmayan ilk HTML çıktısını üretecektir.

<Pitfall>

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.
Bu yöntem, **sulanamayan ve interaktif olmayan HTML oluşturur.** Bu yöntem, React'i basit bir statik sayfa oluşturucu olarak kullanmak istiyorsanız veya e-postalar gibi tamamen statik içerik oluşturuyorsanız kullanışlıdır.

Interactive apps should use [`renderToPipeableStream`](/reference/react-dom/server/renderToPipeableStream) on the server and [`hydrateRoot`](/reference/react-dom/client/hydrateRoot) on the client.
İnteraktif uygulamalar [`renderToPipeableStream`](/reference/react-dom/server/renderToPipeableStream)'i sunucu tarafında kullanmalıdır. [`hydrateRoot`](/reference/react-dom/client/hydrateRoot)'u ise kullanıcı tarafında kullanmalıdır.

</Pitfall>

0 comments on commit 74c51e5

Please sign in to comment.