Skip to content

Commit 1c9f649

Browse files
committed
docs: translate custom hooks (55%)
1 parent 02ce17b commit 1c9f649

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/content/learn/reusing-logic-with-custom-hooks.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,13 +1264,13 @@ function ChatRoom({ roomId }) {
12641264
}
12651265
```
12661266
1267-
**A good custom Hook makes the calling code more declarative by constraining what it does.** For example, `useChatRoom(options)` can only connect to the chat room, while `useImpressionLog(eventName, extraData)` can only send an impression log to the analytics. If your custom Hook API doesn't constrain the use cases and is very abstract, in the long run it's likely to introduce more problems than it solves.
1267+
**İyi bir özel Hook çağıran kodun ne yaptığını sınırlandırarak daha deklaratif hale getirir.** Örneğin, `useChatRoom(options)` sadece sohbet odasına bağlanabilirken, `useImpressionLog(eventName, extraData)` analitiklere bir izlenim kaydı gönderebilir. Eğer özel Hook API'nız kullanım durumlarını sınırlandırmıyorsa ve çok soyutsa, uzun vadede çözdüğünden daha fazla sorun yaratabilir.
12681268
12691269
</DeepDive>
12701270
1271-
### Custom Hooks help you migrate to better patterns {/*custom-hooks-help-you-migrate-to-better-patterns*/}
1271+
### Özel Hook'lar daha iyi kalıplara geçiş yapmanıza yardımcı olur {/*custom-hooks-help-you-migrate-to-better-patterns*/}
12721272
1273-
Effects are an ["escape hatch"](/learn/escape-hatches): you use them when you need to "step outside React" and when there is no better built-in solution for your use case. With time, the React team's goal is to reduce the number of the Effects in your app to the minimum by providing more specific solutions to more specific problems. Wrapping your Effects in custom Hooks makes it easier to upgrade your code when these solutions become available.
1273+
Efekt'ler bir ["kaçış yolu"](/learn/escape-hatches)'dur: Efekt'leri "React'ten dışarı çıkmak" zorunda kaldığınızda ve daha iyi bir yerleşik çözüm olmadığında kullanırsınız. Zamanla, React ekibinin amacı daha spesifik problemlere daha spesifik çözümler sağlayarak uygulamanızdaki Efekt'lerin sayısını minimuma indirmektir. Efekt'lerinizi özel Hook'larla sarmak, bu çözümler mevcut olduğunda kodunuzu güncellemeyi kolaylaştırır.
12741274

12751275
Let's return to this example:
12761276
@@ -1281,19 +1281,19 @@ import { useOnlineStatus } from './useOnlineStatus.js';
12811281
12821282
function StatusBar() {
12831283
const isOnline = useOnlineStatus();
1284-
return <h1>{isOnline ? '✅ Online' : '❌ Disconnected'}</h1>;
1284+
return <h1>{isOnline ? 'Çevrimiçi' : 'Bağlantı kopuk'}</h1>;
12851285
}
12861286
12871287
function SaveButton() {
12881288
const isOnline = useOnlineStatus();
12891289
12901290
function handleSaveClick() {
1291-
console.log('✅ Progress saved');
1291+
console.log('İlerleme kaydedildi');
12921292
}
12931293
12941294
return (
12951295
<button disabled={!isOnline} onClick={handleSaveClick}>
1296-
{isOnline ? 'Save progress' : 'Reconnecting...'}
1296+
{isOnline ? 'İlerlemeyi kaydet' : 'Tekrar bağlanılıyor...'}
12971297
</button>
12981298
);
12991299
}

0 commit comments

Comments
 (0)