Skip to content

Commit 07e2bd9

Browse files
Merge pull request #598 from reactjs/anilcanboga/server-actions
2 parents 3707663 + 7361657 commit 07e2bd9

File tree

3 files changed

+40
-40
lines changed

3 files changed

+40
-40
lines changed

src/content/reference/rsc/server-actions.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
---
2-
title: Server Actions
2+
title: Sunucu Eylemleri
33
canary: true
44
---
55

66
<Intro>
77

8-
Server Actions allow Client Components to call async functions executed on the server.
8+
Sunucu Eylemleri, İstemci Bileşenlerinin sunucuda yürütülen asenkron işlevleri çağırmasına olanak tanır.
99

1010
</Intro>
1111

1212
<InlineToc />
1313

1414
<Note>
1515

16-
#### How do I build support for Server Actions? {/*how-do-i-build-support-for-server-actions*/}
16+
#### Sunucu Eylemleri için nasıl destek oluşturabilirim? {/*how-do-i-build-support-for-server-actions*/}
1717

18-
While Server Actions in React 19 are stable and will not break between major versions, the underlying APIs used to implement Server Actions in a React Server Components bundler or framework do not follow semver and may break between minors in React 19.x.
18+
React 19'daki Sunucu Eylemleri kararlı ve büyük sürümler arasında kırılmayacak olsa da, bir React Sunucu Bileşenleri paketleyicisinde veya çatısında Sunucu Eylemlerini uygulamak için kullanılan temel API'ler semver'ı takip etmez ve React 19.x'teki küçük sürümler arasında kırılabilir.
1919

20-
To support Server Actions as a bundler or framework, we recommend pinning to a specific React version, or using the Canary release. We will continue working with bundlers and frameworks to stabilize the APIs used to implement Server Actions in the future.
20+
Sunucu Eylemlerini bir paketleyici veya çerçeve olarak desteklemek için, belirli bir React sürümüne sabitlemenizi veya Canary sürümünü kullanmanızı öneririz. Gelecekte Sunucu Eylemlerini uygulamak için kullanılan API'leri stabilize etmek için paketleyiciler ve çerçevelerle çalışmaya devam edeceğiz.
2121

2222
</Note>
2323

24-
When a Server Action is defined with the `"use server"` directive, your framework will automatically create a reference to the server function, and pass that reference to the Client Component. When that function is called on the client, React will send a request to the server to execute the function, and return the result.
24+
Bir Sunucu Eylemi `use server` direktifi tanımlandığında, çatınız otomatik olarak sunucu işlevine bir referans oluşturacak ve bu referansı İstemci Bileşenine aktaracaktır. Bu işlev istemcide çağrıldığında, React işlevi yürütmek için sunucuya bir istek gönderecek ve sonucu return edecektir.
2525

26-
Server Actions can be created in Server Components and passed as props to Client Components, or they can be imported and used in Client Components.
26+
Sunucu Eylemleri, Sunucu Bileşenlerinde oluşturulabilir ve İstemci Bileşenlerine destek olarak aktarılabilir veya İstemci Bileşenlerinde içe aktarılabilir ve kullanılabilir
2727

28-
### Creating a Server Action from a Server Component {/*creating-a-server-action-from-a-server-component*/}
28+
### Sunucu Bileşeninden Sunucu Eylemi Oluşturma {/*creating-a-server-action-from-a-server-component*/}
2929

30-
Server Components can define Server Actions with the `"use server"` directive:
30+
Sunucu Bileşenleri `use server` yönergesi ile Sunucu Eylemleri tanımlayabilir:
3131

3232
```js [[2, 7, "'use server'"], [1, 5, "createNoteAction"], [1, 12, "createNoteAction"]]
33-
// Server Component
33+
// Sunucu Bileşeni
3434
import Button from './Button';
3535

3636
function EmptyNote () {
3737
async function createNoteAction() {
38-
// Server Action
38+
// Sunucu Eylemi
3939
'use server';
4040

4141
await db.notes.create();
@@ -45,24 +45,24 @@ function EmptyNote () {
4545
}
4646
```
4747

48-
When React renders the `EmptyNote` Server Component, it will create a reference to the `createNoteAction` function, and pass that reference to the `Button` Client Component. When the button is clicked, React will send a request to the server to execute the `createNoteAction` function with the reference provided:
48+
React, `EmptyNote` Sunucu Bileşenini işlediğinde, `createNoteAction` fonksiyonuna bir referans oluşturacak ve bu referansı `Button` İstemci Bileşenine aktaracaktır. Butona tıklandığında, React, sağlanan referansla `createNoteAction` fonksiyonunu çalıştırmak için sunucuya bir istek gönderecektir:
4949

5050
```js {5}
5151
"use client";
5252

5353
export default function Button({onClick}) {
5454
console.log(onClick);
5555
// {$$typeof: Symbol.for("react.server.reference"), $$id: 'createNoteAction'}
56-
return <button onClick={() => onClick()}>Create Empty Note</button>
56+
return <button onClick={() => onClick()}>Boş Not Oluştur</button>
5757
}
5858
```
5959

60-
For more, see the docs for [`"use server"`](/reference/rsc/use-server).
60+
Daha fazlası için [`use server`](/reference/rsc/use-server) dokümanlarına bakın.
6161

6262

63-
### Importing Server Actions from Client Components {/*importing-server-actions-from-client-components*/}
63+
### İstemci Bileşenlerinden Sunucu Eylemlerini İçe Aktarma {/*importing-server-actions-from-client-components*/}
6464

65-
Client Components can import Server Actions from files that use the `"use server"` directive:
65+
İstemci Bileşenleri, `“use server”` direktifini kullanan dosyalardan Sunucu Eylemlerini içe aktarabilir:
6666

6767
```js [[1, 3, "createNoteAction"]]
6868
"use server";
@@ -73,7 +73,7 @@ export async function createNoteAction() {
7373

7474
```
7575

76-
When the bundler builds the `EmptyNote` Client Component, it will create a reference to the `createNoteAction` function in the bundle. When the `button` is clicked, React will send a request to the server to execute the `createNoteAction` function using the reference provided:
76+
Paketleyici `EmptyNote` İstemci Bileşenini oluşturduğunda, paketteki `createNoteAction` işlevine bir referans oluşturacaktır. Butona tıklandığında React, sağlanan referansı kullanarak `createNoteAction` fonksiyonunu çalıştırmak için sunucuya bir istek gönderecektir:
7777

7878
```js [[1, 2, "createNoteAction"], [1, 5, "createNoteAction"], [1, 7, "createNoteAction"]]
7979
"use client";
@@ -86,18 +86,18 @@ function EmptyNote() {
8686
}
8787
```
8888

89-
For more, see the docs for [`"use server"`](/reference/rsc/use-server).
89+
Daha fazlası için [`use server`](/reference/rsc/use-server) dokümanlarına bakın.
9090

91-
### Composing Server Actions with Actions {/*composing-server-actions-with-actions*/}
91+
### Sunucu Eylemlerini Eylemlerle Oluşturma {/*composing-server-actions-with-actions*/}
9292

93-
Server Actions can be composed with Actions on the client:
93+
Sunucu Eylemleri, istemci üzerindeki Eylemlerle birlikte oluşturulabilir:
9494

9595
```js [[1, 3, "updateName"]]
9696
"use server";
9797

9898
export async function updateName(name) {
9999
if (!name) {
100-
return {error: 'Name is required'};
100+
return {error: 'İsim gereklidir'};
101101
}
102102
await db.users.updateName(name);
103103
}
@@ -128,21 +128,21 @@ function UpdateName() {
128128
return (
129129
<form action={submitAction}>
130130
<input type="text" name="name" disabled={isPending}/>
131-
{state.error && <span>Failed: {state.error}</span>}
131+
{state.error && <span>Başarısız: {state.error}</span>}
132132
</form>
133133
)
134134
}
135135
```
136136

137-
This allows you to access the `isPending` state of the Server Action by wrapping it in an Action on the client.
137+
Bu, Sunucu Eyleminin `isPending` durumuna, istemcideki bir Eyleme sararak erişmenizi sağlar.
138138

139-
For more, see the docs for [Calling a Server Action outside of `<form>`](/reference/rsc/use-server#calling-a-server-action-outside-of-form)
139+
Daha fazlası için [Sunucu Eylemini `<form>` dışında çağırma](/reference/rsc/use-server#calling-a-server-action-outside-of-form) dokümanlarına bakın
140140

141-
### Form Actions with Server Actions {/*form-actions-with-server-actions*/}
141+
### Sunucu Eylemleri ile Form Eylemleri {/*form-actions-with-server-actions*/}
142142

143-
Server Actions work with the new Form features in React 19.
143+
Sunucu Eylemleri, React 19'daki yeni Form özellikleri ile çalışır.
144144

145-
You can pass a Server Action to a Form to automatically submit the form to the server:
145+
Formu otomatik olarak sunucuya göndermek için bir Form'a bir Sunucu Eylemi aktarabilirsiniz:
146146

147147

148148
```js [[1, 3, "updateName"], [1, 7, "updateName"]]
@@ -159,13 +159,13 @@ function UpdateName() {
159159
}
160160
```
161161

162-
When the Form submission succeeds, React will automatically reset the form. You can add `useActionState` to access the pending state, last response, or to support progressive enhancement.
162+
Form gönderimi başarılı olduğunda, React formu otomatik olarak sıfırlayacaktır. Pending state, son yanıta erişmek veya aşamalı geliştirmeyi desteklemek için `useActionState` ekleyebilirsiniz.
163163

164-
For more, see the docs for [Server Actions in Forms](/reference/rsc/use-server#server-actions-in-forms).
164+
Daha fazla bilgi için [Formlarda Sunucu Eylemleri](/reference/rsc/use-server#server-actions-in-forms) dokümanlarına bakın.
165165

166-
### Server Actions with `useActionState` {/*server-actions-with-use-action-state*/}
166+
### `UseActionState` ile Sunucu Eylemleri {/*server-actions-with-use-action-state*/}
167167

168-
You can compose Server Actions with `useActionState` for the common case where you just need access to the action pending state and last returned response:
168+
Yalnızca pending state'ine ve son döndürülen yanıta erişmeniz gereken yaygın durumlar için Sunucu Eylemlerini `useActionState` ile oluşturabilirsiniz:
169169

170170
```js [[1, 3, "updateName"], [1, 6, "updateName"], [2, 6, "submitAction"], [2, 9, "submitAction"]]
171171
"use client";
@@ -178,19 +178,19 @@ function UpdateName() {
178178
return (
179179
<form action={submitAction}>
180180
<input type="text" name="name" disabled={isPending}/>
181-
{state.error && <span>Failed: {state.error}</span>}
181+
{state.error && <span>Başarısız: {state.error}</span>}
182182
</form>
183183
);
184184
}
185185
```
186186

187-
When using `useActionState` with Server Actions, React will also automatically replay form submissions entered before hydration finishes. This means users can interact with your app even before the app has hydrated.
187+
Sunucu Eylemleri ile `useActionState` kullanıldığında, React ayrıca hidrasyon tamamlanmadan önce girilen form gönderimlerini otomatik olarak yeniden oynatacaktır. Bu, kullanıcıların uygulama hidratlanmadan önce bile uygulamanızla etkileşime girebileceği anlamına gelir.
188188

189-
For more, see the docs for [`useActionState`](/reference/react-dom/hooks/useFormState).
189+
Daha fazlası için [`useActionState`](/reference/react-dom/hooks/useFormState) dokümanlarına bakın.
190190

191-
### Progressive enhancement with `useActionState` {/*progressive-enhancement-with-useactionstate*/}
191+
### `UseActionState` ile aşamalı iyileştirme {/*progressive-enhancement-with-useactionstate*/}
192192

193-
Server Actions also support progressive enhancement with the third argument of `useActionState`.
193+
Sunucu Eylemleri ayrıca `useActionState` üçüncü bağımsız değişkeni ile aşamalı geliştirmeyi de destekler.
194194

195195
```js [[1, 3, "updateName"], [1, 6, "updateName"], [2, 6, "/name/update"], [3, 6, "submitAction"], [3, 9, "submitAction"]]
196196
"use client";
@@ -208,6 +208,6 @@ function UpdateName() {
208208
}
209209
```
210210

211-
When the <CodeStep step={2}>permalink</CodeStep> is provided to `useActionState`, React will redirect to the provided URL if the form is submitted before the JavaScript bundle loads.
211+
<CodeStep step={2}>permalink</CodeStep> `useActionState` için sağlandığında, form JavaScript paketi yüklenmeden önce gönderilirse React sağlanan URL'ye yönlendirecektir.
212212

213-
For more, see the docs for [`useActionState`](/reference/react-dom/hooks/useFormState).
213+
Daha fazlası için [`useActionState`](/reference/react-dom/hooks/useFormState) dokümanlarına bakın.

src/content/reference/rsc/server-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: React Server Components
2+
title: React Sunucu Bileşenleri
33
canary: true
44
---
55

src/sidebarReference.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@
369369
"canary": true
370370
},
371371
{
372-
"title": "Server Actions",
372+
"title": "Sunucu Eylemleri",
373373
"path": "/reference/rsc/server-actions",
374374
"canary": true
375375
},

0 commit comments

Comments
 (0)