Skip to content

Commit 19c6fda

Browse files
Merge pull request #225 from mohamedsgap/doc-concurrent-mode-reference
[Done] Translate Concurrent Mode API Reference
2 parents d919b80 + bcbce3a commit 19c6fda

1 file changed

Lines changed: 46 additions & 48 deletions

File tree

content/docs/concurrent-mode-reference.md

Lines changed: 46 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: concurrent-mode-reference
3-
title: Concurrent Mode API Reference (Experimental)
3+
title: مرجع واجهة برمجة التطبيقات للوضع المتزامن (تجريبي)
44
permalink: docs/concurrent-mode-reference.html
55
prev: concurrent-mode-adoption.html
66
---
@@ -14,19 +14,18 @@ prev: concurrent-mode-adoption.html
1414

1515
<div class="scary">
1616

17-
>Caution:
17+
>تحذير:
18+
>تصف هذه الصفحة **الميزات التجريبية التي [ليست متوفرة بعد](/docs/concurrent-mode-approach.html) في إصدار ثابت**. لا تعتمد على تصميمات React التجريبية في تطبيقات الإنتاج. قد تتغير هذه الميزات بشكل كبير ودون سابق إنذار قبل أن تصبح جزءًا من React.
1819
>
19-
>This page describes **experimental features that are [not yet available](/docs/concurrent-mode-adoption.html) in a stable release**. Don't rely on experimental builds of React in production apps. These features may change significantly and without a warning before they become a part of React.
20-
>
21-
>This documentation is aimed at early adopters and people who are curious. **If you're new to React, don't worry about these features** -- you don't need to learn them right now.
20+
>تستهدف هذه المستندات إلى المُتَبنّين المبكرين والأشخاص الفضوليين. **إذا كنت جديدًا في React، فلا تقلق بشأن هذه الميزات** -- لست بحاجة إلى تعلمها الآن.
2221
2322
</div>
2423

25-
This page is an API reference for the React [Concurrent Mode](/docs/concurrent-mode-intro.html). If you're looking for a guided introduction instead, check out [Concurrent UI Patterns](/docs/concurrent-mode-patterns.html).
24+
هذه الصفحة هي مرجع واجهة برمجة التطبيقات لـ React [الوضع المتزامن](/docs/concurrent-mode-intro.html). إذا كنت تبحث عن مقدمة موجهة بدلاً من ذلك، فتحقق من [أنماط واجهة المستخدم المتزامنة](/docs/concurrent-mode-patterns.html).
2625

27-
**Note: This is a Community Preview and not the final stable version. There will likely be future changes to these APIs. Use at your own risk!**
26+
**ملاحظة: هذه هي معاينة المجتمع وليست الإصدار النهائي المستقر. من المحتمل أن تكون هناك تغييرات مستقبلية على واجهات برمجة التطبيقات تلك. استخدام على مسؤوليتك الخاصة!**
2827

29-
- [Enabling Concurrent Mode](#concurrent-mode)
28+
- [تمكين الوضع المتزامن](#concurrent-mode)
3029
- [`createRoot`](#createroot)
3130
- [`createBlockingRoot`](#createblockingroot)
3231
- [Suspense](#suspense)
@@ -35,29 +34,29 @@ This page is an API reference for the React [Concurrent Mode](/docs/concurrent-m
3534
- [`useTransition`](#usetransition)
3635
- [`useDeferredValue`](#usedeferredvalue)
3736

38-
## Enabling Concurrent Mode {#concurrent-mode}
37+
## تمكين الوضع المتزامن {#concurrent-mode}
3938

4039
### `createRoot` {#createroot}
4140

4241
```js
4342
ReactDOM.createRoot(rootNode).render(<App />);
4443
```
4544

46-
Replaces `ReactDOM.render(<App />, rootNode)` and enables Concurrent Mode.
45+
تستبدل `ReactDOM.render(<App />, rootNode)` وتُمَكّن الوضع المتزامن.
4746

48-
For more information on Concurrent Mode, check out the [Concurrent Mode documentation.](/docs/concurrent-mode-intro.html)
47+
لمزيد من المعلومات حول الوضع المتزامن، راجع [مستندات الوضع المتزامن.](/docs/concurrent-mode-intro.html)
4948

5049
### `createBlockingRoot` {#createblockingroot}
5150

5251
```js
5352
ReactDOM.createBlockingRoot(rootNode).render(<App />)
5453
```
5554

56-
Replaces `ReactDOM.render(<App />, rootNode)` and enables [Blocking Mode](/docs/concurrent-mode-adoption.html#migration-step-blocking-mode).
55+
يستبدل `ReactDOM.render(<App />, rootNode)` و يُمَكّن [الوضع الإعتراضي](/docs/concurrent-mode-adoption.html#migration-step-blocking-mode).
5756

58-
Opting into Concurrent Mode introduces semantic changes to how React works. This means that you can't use Concurrent Mode in just a few components. Because of this, some apps may not be able to migrate directly to Concurrent Mode.
57+
إختيار الوضع المتزامن إلى إدخال تغييرات دلالية في طريقة عمل React. هذا يعني أنه لا يمكنك استخدام الوضع المتزامن في جُزء من المكونات. وبسبب هذا، قد لا تتمكن بعض التطبيقات من الإنتقال مباشرة إلى استعمال الوضع المتزامن.
5958

60-
Blocking Mode only contains a small subset of Concurrent Mode features and is intended as an intermediary migration step for apps that are unable to migrate directly.
59+
يحتوي الوضع الإعتراضي (blocking mode) فقط على مجموعة فرعية صغيرة من ميزات الوضع المتزامن ويقصد به كخطوة ترحيل وسيطة للتطبيقات التي لا تستطيع الترحيل مباشرة.
6160

6261
## Suspense API {#suspense}
6362

@@ -70,13 +69,13 @@ Blocking Mode only contains a small subset of Concurrent Mode features and is in
7069
</Suspense>
7170
```
7271

73-
`Suspense` lets your components "wait" for something before they can render, showing a fallback while waiting.
72+
`Suspense` يتيح لمكوناتك "الانتظار" لشيء ما قبل أن تتمكن من التصيير، مع إظهار احتياطي أثناء الانتظار.
7473

75-
In this example, `ProfileDetails` is waiting for an asynchronous API call to fetch some data. While we wait for `ProfileDetails` and `ProfilePhoto`, we will show the `Loading...` fallback instead. It is important to note that until all children inside `<Suspense>` has loaded, we will continue to show the fallback.
74+
في هذا المثال، ينتظر `ProfileDetails` اتصال API غير متزامن لجلب بعض البيانات. أثناء انتظار ` ProfileDetails` و `ProfilePhoto`، سنعرض الخيار `جاري التحميل ...` بدلاً من ذلك. من المهم ملاحظة أنه حتى يتم تحميل جميع الأطفال داخل `<Suspense>`، سنستمر في إظهار الاحتياط.
7675

77-
`Suspense` takes two props:
78-
* **fallback** takes a loading indicator. The fallback is shown until all of the children of the `Suspense` component have finished rendering.
79-
* **unstable_avoidThisFallback** takes a boolean. It tells React whether to "skip" revealing this boundary during the initial load. This API will likely be removed in a future release.
76+
`Suspense` يأخذ اثنين props:
77+
* **fallback** يأخذ مؤشر تحميل. يظهر العرض الاحتياطي حتى الانتهاء من تصيير كافة مكون `Suspense`.
78+
* **unstable_avoidThisFallback** يأخذ قيم منطقية. يخبر React ما إذا كان "تخطي" الكشف عن هذه الحدود أثناء التحميل الأولي. من المحتمل أن تتم إزالة واجهة برمجة التطبيقات هذه في إصدار مستقبلي.
8079

8180
### `<SuspenseList>` {#suspenselist}
8281

@@ -95,19 +94,19 @@ In this example, `ProfileDetails` is waiting for an asynchronous API call to fet
9594
</SuspenseList>
9695
```
9796

98-
`SuspenseList` helps coordinate many components that can suspend by orchestrating the order in which these components are revealed to the user.
97+
`SuspenseList` يساعد في تنسيق العديد من المكونات التي يمكن تعليقها من خلال تنسيق الترتيب الذي يتم من خلاله الكشف عن هذه المكونات للمستخدم.
9998

100-
When multiple components need to fetch data, this data may arrive in an unpredictable order. However, if you wrap these items in a `SuspenseList`, React will not show an item in the list until previous items have been displayed (this behavior is adjustable).
99+
عندما تحتاج مكونات متعددة إلى جلب البيانات، قد تصل هذه البيانات بترتيب غير متوقع. ومع ذلك، إذا قمت بلف هذه العناصر في `SuspenseList`، فلن تظهر React عنصرًا في القائمة حتى يتم عرض العناصر السابقة (هذا السلوك قابل للتعديل).
101100

102-
`SuspenseList` takes two props:
103-
* **revealOrder (forwards, backwards, together)** defines the order in which the `SuspenseList` children should be revealed.
104-
* `together` reveals *all* of them when they're ready instead of one by one.
105-
* **tail (collapsed, hidden)** dictates how unloaded items in a `SuspenseList` is shown.
106-
* By default, `SuspenseList` will show all fallbacks in the list.
107-
* `collapsed` shows only the next fallback in the list.
108-
* `hidden` doesn't show any unloaded items.
101+
`SuspenseList` يأخذ اثنين props:
102+
* **revealOrder (forwards, backwards, together)** يحدد الترتيب الذي فيه `SuspenseList` يجب الكشف عن الأطفال.
103+
* `together` تكشف *الكل* عندما يكونون على استعداد بدلاً من واحدة تِلوَ الأخرى.
104+
* **tail (collapsed, hidden)** يملي كيف يتم عرض العناصر التي تم تحميلها فى `SuspenseList`.
105+
* بشكل افتراضي, `SuspenseList` سيظهر جميع الاحتياطيات في القائمة.
106+
* `collapsed` يظهر فقط الاحتياطية التالية في القائمة.
107+
* `hidden` لا تظهر أي عناصر غير محمل.
109108

110-
Note that `SuspenseList` only operates on the closest `Suspense` and `SuspenseList` components below it. It does not search for boundaries deeper than one level. However, it is possible to nest multiple `SuspenseList` components in each other to build grids.
109+
لاحظ أن `SuspenseList` تعمل فقط على أقرب مكونات `Suspense` و مكونات `SuspenseList` تحتها. لا يبحث عن حدود أعمق من مستوى واحد. ومع ذلك، فمن الممكن تداخل مكونات `SuspenseList` متعددة في بعضها البعض لبناء شبكات.
111110

112111
### `useTransition` {#usetransition}
113112

@@ -117,13 +116,13 @@ const SUSPENSE_CONFIG = { timeoutMs: 2000 };
117116
const [startTransition, isPending] = useTransition(SUSPENSE_CONFIG);
118117
```
119118

120-
`useTransition` allows components to avoid undesirable loading states by waiting for content to load before **transitioning to the next screen**. It also allows components to defer slower, data fetching updates until subsequent renders so that more crucial updates can be rendered immediately.
119+
`useTransition` يسمح للمكونات بتجنب حالات التحميل غير المرغوب فيها من خلال انتظار تحميل المحتوى قبل **الانتقال إلى الشاشة التالية**. كما يسمح للمكونات بتأجيل التحديثات بشكل أبطأ، وجلب البيانات حتى يتم تقديمها لاحقًا بحيث يمكن تقديم تحديثات أكثر أهمية على الفور.
121120

122-
The `useTransition` hook returns two values in an array.
123-
* `startTransition` is a function that takes a callback. We can use it to tell React which state we want to defer.
124-
* `isPending` is a boolean. It's React's way of informing us whether we're waiting for the transition to finish.
121+
يُعيد الخطاف `useTransition` قيمتين في مصفوفة.
122+
* `startTransition` هي دالّة التي تأخذ callback. يمكننا استخدامه لإخبار React بالحالة التي نريد تأجيلها.
123+
* `isPending` هي boolean. إنها طريقة React لإعلامنا ما إذا كنا ننتظر انتهاء الانتقال.
125124

126-
**If some state update causes a component to suspend, that state update should be wrapped in a transition.**
125+
**إذا تسبب تحديث الحالة في تعليق أحد المكونات، فيجب أن يتم تغليف تحديث الحالة هذا في مرحلة انتقالية.**
127126

128127
```js
129128
const SUSPENSE_CONFIG = { timeoutMs: 2000 };
@@ -153,39 +152,38 @@ function App() {
153152
}
154153
```
155154

156-
In this code, we've wrapped our data fetching with `startTransition`. This allows us to start fetching the profile data right away, while deferring the render of the next profile page and its associated `Spinner` for 2 seconds (the time shown in `timeoutMs`).
155+
في هذه الشفرة، قمنا بلف جلب بياناتنا بـ `startTransition`. يتيح لنا ذلك البدء في جلب بيانات الملف الشخصي فورًا، مع تأجيل عرض صفحة الملف الشخصي التالية و `Spinner` المرتبط بها لمدة ثانيتين (الوقت الموضح في `timeoutMs`).
157156

158-
The `isPending` boolean lets React know that our component is transitioning, so we are able to let the user know this by showing some loading text on the previous profile page.
157+
تتيح القيمة المنطقية `isPending` لـ React معرفة أن المكون الخاص بنا يتحول، لذلك يمكننا إخبار المستخدم بذلك من خلال عرض نص التحميل على صفحة الملف الشخصي السابقة.
159158

160-
**For an in-depth look at transitions, you can read [Concurrent UI Patterns](/docs/concurrent-mode-patterns.html#transitions).**
159+
**لإلقاء نظرة متعمقة على التحولات، يمكنك قراءة [أنماط و أساليب واجهة المستخدم](/docs/concurrent-mode-patterns.html#transitions).**
161160

162161
#### useTransition Config {#usetransition-config}
163162

164163
```js
165164
const SUSPENSE_CONFIG = { timeoutMs: 2000 };
166165
```
167166

168-
`useTransition` accepts an **optional Suspense Config** with a `timeoutMs`. This timeout (in milliseconds) tells React how long to wait before showing the next state (the new Profile Page in the above example).
169-
170-
**Note: We recommend that you share Suspense Config between different modules.**
167+
يقبل `useTransition` **Suspense Config اختياري** مع `timeoutMs`. هذه المهلة (بالمللي ثانية) تخبر React إلى متى الانتظار قبل عرض الحالة التالية (صفحة الملف الشخصي الجديدة في المثال أعلاه).
171168

169+
**ملاحظة: نوصيك بمشاركة Suspense Config بين الوحدات المختلفة.**
172170

173171
### `useDeferredValue` {#usedeferredvalue}
174172

175173
```js
176174
const deferredValue = useDeferredValue(value, { timeoutMs: 2000 });
177175
```
178176

179-
Returns a deferred version of the value that may "lag behind" it for at most `timeoutMs`.
177+
لعرض نسخة مؤجلة من القيمة التي قد "تتخلف" عنها على الأكثر لـ `timeoutMs`.
180178

181-
This is commonly used to keep the interface responsive when you have something that renders immediately based on user input and something that needs to wait for a data fetch.
179+
يُستخدم هذا بشكل شائع للحفاظ على استجابة الواجهة عندما يكون لديك شيء يتم تصييره فورًا بناءً على مُدخلات المستخدم وشيء يحتاج إلى انتظار جلب البيانات.
182180

183-
A good example of this is a text input.
181+
مثال جيد على ذلك هو إدخال النص.
184182

185183
```js
186184
function App() {
187185
const [text, setText] = useState("hello");
188-
const deferredText = useDeferredValue(text, { timeoutMs: 2000 });
186+
const deferredText = useDeferredValue(text, { timeoutMs: 2000 });
189187

190188
return (
191189
<div className="App">
@@ -199,16 +197,16 @@ function App() {
199197
}
200198
```
201199

202-
This allows us to start showing the new text for the `input` immediately, which allows the webpage to feel responsive. Meanwhile, `MySlowList` "lags behind" for up to 2 seconds according to the `timeoutMs` before updating, allowing it to render with the current text in the background.
200+
يتيح لنا ذلك البدء في عرض النص الجديد لـ `الإدخال` على الفور، مما يسمح لصفحة الويب بالشعور بالاستجابة. في هذه الأثناء، `MySlowList` "متخلفة" لمدة تصل إلى ثانيتين وفقًا لـ `timeoutMs` قبل التحديث، مما يتيح تصييرها مع النص الحالي في الخلفية.
203201

204-
**For an in-depth look at deferring values, you can read [Concurrent UI Patterns](/docs/concurrent-mode-patterns.html#deferring-a-value).**
202+
**لإلقاء نظرة متعمقة على تأجيل القيم، يمكنك قراءة [Concurrent UI Patterns](/docs/concurrent-mode-patterns.html#deferring-a-value).**
205203

206204
#### useDeferredValue Config {#usedeferredvalue-config}
207205

208206
```js
209207
const SUSPENSE_CONFIG = { timeoutMs: 2000 };
210208
```
211209

212-
`useDeferredValue` accepts an **optional Suspense Config** with a `timeoutMs`. This timeout (in milliseconds) tells React how long the deferred value is allowed to lag behind.
210+
يقبل `useDeferredValue` **Suspense Config اختياري** مع `timeoutMs`. هذه المهلة (بالمللي ثانية) تخبرنا React عن المدة التي يُسمح فيها بالقيمة المؤجلة بالتخلف.
213211

214-
React will always try to use a shorter lag when network and device allows it.
212+
سيحاول React دائمًا استخدام تأخرٍ أقصر عندما تسمح به الشبكة والجهاز.

0 commit comments

Comments
 (0)