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
Copy file name to clipboardExpand all lines: src/content/reference/react-dom/components/index.md
+46-46Lines changed: 46 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,54 +1,54 @@
1
1
---
2
-
title: "React DOM Components"
2
+
title: "مكوّنات React DOM"
3
3
---
4
4
5
5
<Intro>
6
6
7
-
React supports all of the browser built-in [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML/Element)and[SVG](https://developer.mozilla.org/en-US/docs/Web/SVG/Element)components.
7
+
يدعم React جميع مكوّنات [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML/Element)و[SVG](https://developer.mozilla.org/en-US/docs/Web/SVG/Element)المدمجة في المتصفح.
8
8
9
9
</Intro>
10
10
11
11
---
12
12
13
-
## Common components {/*common-components*/}
13
+
## المكوّنات الشائعة {/*common-components*/}
14
14
15
-
All of the built-in browser components support some props and events.
15
+
تدعم جميع مكوّنات المتصفح المدمجة بعض الخصائص والأحداث.
They are special in React because passing the`value`prop to them makes them *[controlled.](/reference/react-dom/components/input#controlling-an-input-with-a-state-variable)*
31
+
تتميّز في React لأن تمرير خاصية`value`إليها يجعلها *[متحكَّمًا فيها.](/reference/react-dom/components/input#controlling-an-input-with-a-state-variable)*
32
32
33
33
---
34
34
35
-
## Resource and Metadata Components {/*resource-and-metadata-components*/}
35
+
## مكوّنات الموارد والبيانات الوصفية {/*resource-and-metadata-components*/}
36
36
37
-
These built-in browser components let you load external resources or annotate the document with metadata:
37
+
تتيح لك مكوّنات المتصفح المدمجة هذه تحميل موارد خارجية أو إثراء المستند ببيانات وصفية:
They are special in React because React can render them into the document head, suspend while resources are loading, and enact other behaviors that are described on the reference page for each specific component.
45
+
تتميّز في React لأن React يمكنه تصييرها في رأس المستند، وتعليق التنفيذ أثناء تحميل الموارد، وتطبيق سلوكيات أخرى تُوضَّح في صفحة المرجع لكل مكوّن.
46
46
47
47
---
48
48
49
-
## All HTML components {/*all-html-components*/}
49
+
## جميع مكوّنات HTML {/*all-html-components*/}
50
50
51
-
React supports all built-in browser HTML components. This includes:
51
+
يدعم React جميع مكوّنات HTML المدمجة في المتصفح. من ذلك:
@@ -154,39 +154,39 @@ React supports all built-in browser HTML components. This includes:
154
154
155
155
<Note>
156
156
157
-
Similar to the [DOM standard,](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model) React uses a `camelCase`convention for prop names. For example, you'll write `tabIndex`instead of`tabindex`. You can convert existing HTML to JSX with an [online converter.](https://transform.tools/html-to-jsx)
157
+
مثل [معيار DOM،](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model)يستخدم React تسمية `camelCase`لأسماء الخصائص. مثلاً تكتب `tabIndex`بدلًا من`tabindex`. يمكنك تحويل HTML الحالي إلى JSX باستخدام [محوّل على الويب.](https://transform.tools/html-to-jsx)
158
158
159
159
</Note>
160
160
161
161
---
162
162
163
-
### Custom HTML elements {/*custom-html-elements*/}
163
+
### عناصر HTML مخصصة {/*custom-html-elements*/}
164
164
165
-
If you render a tag with a dash, like `<my-element>`, React will assume you want to render a [custom HTML element.](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements)
165
+
إذا صيّرت وسمًا يحتوي على شرطة، مثل `<my-element>`، فسيفترض React أنك تريد تصيير [عنصر HTML مخصص.](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements)
166
166
167
-
If you render a built-in browser HTML element with an[`is`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/is) attribute, it will also be treated as a custom element.
167
+
إذا صيّرت عنصر HTML مدمجًا مع سمة[`is`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/is)، فسيُعامل أيضًا كعنصر مخصص.
168
168
169
-
#### Setting values on custom elements {/*attributes-vs-properties*/}
169
+
#### تعيين القيم على العناصر المخصصة {/*attributes-vs-properties*/}
170
170
171
-
Custom elements have two methods of passing data into them:
171
+
للعناصر المخصصة طريقتان لتمرير البيانات إليها:
172
172
173
-
1)Attributes: Which are displayed in markup and can only be set to string values
174
-
2)Properties: Which are not displayed in markup and can be set to arbitrary JavaScript values
173
+
1)السمات: تظهر في التعليمات ولا يمكن تعيينها إلا لقيم نصية
174
+
2)الخصائص: لا تظهر في التعليمات ويمكن تعيينها لقيم JavaScript بأي نوع
175
175
176
-
By default, React will pass values bound in JSX as attributes:
176
+
بشكل افتراضي، يمرّر React القيم المربوطة في JSX كسمات:
177
177
178
178
```jsx
179
179
<my-element value="Hello, world!"></my-element>
180
180
```
181
181
182
-
Non-string JavaScript values passed to custom elements will be serialized by default:
182
+
تُسلسل القيم غير النصية الممرَّرة للعناصر المخصصة افتراضيًا:
183
183
184
184
```jsx
185
-
//Will be passed as `"1,2,3"` as the output of `[1,2,3].toString()`
185
+
//ستُمرَّر كـ `"1,2,3"` أي ناتج `[1,2,3].toString()`
186
186
<my-element value={[1,2,3]}></my-element>
187
187
```
188
188
189
-
React will, however, recognize an custom element's property as one that it may pass arbitrary values to if the property name shows up on the class during construction:
189
+
سيتعرّف React مع ذلك على خاصية عنصر مخصص يمكنه تمرير قيم بأي نوع إليها إذا ظهر اسم الخاصية على الصنف أثناء الإنشاء:
190
190
191
191
<Sandpack>
192
192
@@ -224,9 +224,9 @@ export function App() {
224
224
225
225
</Sandpack>
226
226
227
-
#### Listening for events on custom elements {/*custom-element-events*/}
227
+
#### الاستماع للأحداث على العناصر المخصصة {/*custom-element-events*/}
228
228
229
-
A common pattern when using custom elements is that they may dispatch [`CustomEvent`s](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent)rather than accept a function to call when an event occur. You can listen for these events using an `on`prefix when binding to the event via JSX.
229
+
من الأنماط الشائعة مع العناصر المخصصة أنها قد ترسل [`CustomEvent`s](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent)بدل قبول دالة تُستدعى عند حدوث الحدث. يمكنك الاستماع لهذه الأحداث باستخدام بادئة `on`عند الربط عبر JSX.
230
230
231
231
<Sandpack>
232
232
@@ -285,7 +285,7 @@ export function App() {
285
285
286
286
<Note>
287
287
288
-
Events are case-sensitive and support dashes (`-`). Preserve the casing of the event and include all dashes when listening for custom element's events:
288
+
الأحداث حسّاسة لحالة الأحرف وتدعم الشرطات (`-`). احفظ حالة الأحرف في اسم الحدث وضمّن كل الشرطات عند الاستماع لأحداث العنصر المخصص:
289
289
290
290
```jsx
291
291
// Listens for `say-hi` events
@@ -297,9 +297,9 @@ Events are case-sensitive and support dashes (`-`). Preserve the casing of the e
297
297
</Note>
298
298
---
299
299
300
-
## All SVG components {/*all-svg-components*/}
300
+
## جميع مكوّنات SVG {/*all-svg-components*/}
301
301
302
-
React supports all built-in browser SVG components. This includes:
302
+
يدعم React جميع مكوّنات SVG المدمجة في المتصفح. من ذلك:
@@ -370,20 +370,20 @@ React supports all built-in browser SVG components. This includes:
370
370
371
371
<Note>
372
372
373
-
Similar to the [DOM standard,](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model) React uses a `camelCase`convention for prop names. For example, you'll write `tabIndex`instead of`tabindex`. You can convert existing SVG to JSX with an [online converter.](https://transform.tools/)
374
-
375
-
Namespaced attributes also have to be written without the colon:
376
-
377
-
*`xlink:actuate`becomes`xlinkActuate`.
378
-
*`xlink:arcrole`becomes`xlinkArcrole`.
379
-
*`xlink:href`becomes`xlinkHref`.
380
-
*`xlink:role`becomes`xlinkRole`.
381
-
*`xlink:show`becomes`xlinkShow`.
382
-
*`xlink:title`becomes`xlinkTitle`.
383
-
*`xlink:type`becomes`xlinkType`.
384
-
*`xml:base`becomes`xmlBase`.
385
-
*`xml:lang`becomes`xmlLang`.
386
-
*`xml:space`becomes`xmlSpace`.
387
-
*`xmlns:xlink`becomes`xmlnsXlink`.
373
+
مثل [معيار DOM،](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model)يستخدم React تسمية `camelCase`لأسماء الخصائص. مثلاً تكتب `tabIndex`بدلًا من`tabindex`. يمكنك تحويل SVG الحالي إلى JSX باستخدام [محوّل على الويب.](https://transform.tools/)
374
+
375
+
يجب كتابة السمات ذات المساحة الاسمية بدون النقطتين:
0 commit comments