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/learn/javascript-in-jsx-with-curly-braces.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -244,9 +244,9 @@ JSX هي لغة قوالب بسيطة جدًا لأنها تسمح لك بتنظ
244
244
245
245
<Challenges>
246
246
247
-
#### Fix the mistake {/*fix-the-mistake*/}
247
+
#### أصلح الخطأ {/*fix-the-mistake*/}
248
248
249
-
This code crashes with an error saying`Objects are not valid as a React child`:
249
+
هذا الكود يتعطل ويظهر خطأ `Objects are not valid as a React child`:
250
250
251
251
<Sandpack>
252
252
@@ -286,15 +286,15 @@ body > div > div { padding: 20px; }
286
286
287
287
</Sandpack>
288
288
289
-
Can you find the problem?
289
+
هل يمكنك إيجاد المشكلة؟
290
290
291
-
<Hint>Look for what's inside the curly braces. Are we putting the right thing there?</Hint>
291
+
<Hint>ابحث عن ما يوجد داخل الأقواس المجعدة. هل يتم وضع الشيء الصحيح هناك؟</Hint>
292
292
293
293
<Solution>
294
294
295
-
This is happening because this example renders *an object itself* into the markup rather than a string:`<h1>{person}'s Todos</h1>`is trying to render the entire `person`object! Including raw objects as text content throws an error because React doesn't know how you want to display them.
295
+
يحدث هذا بسبب أن هذا المثال يقوم بتصيير *كائن بذاته* في الترميز بدلاً من string: `<h1>{person}'s قائمة المهام</h1>`يحاول عرض كائن `person`بأكمله! إدراج الكائنات المباشرة كمحتوى نصي يُثير خطأ لأن React لا يعرف كيف ترغب في عرضها.
296
296
297
-
To fix it, replace `<h1>{person}'s Todos</h1>`with`<h1>{person.name}'s Todos</h1>`:
297
+
لحل هذه المشكلة، قم بتبديل `<h1>{person}'s Todos</h1>` بـ `<h1>{person.name}'s Todos</h1>`:
298
298
299
299
<Sandpack>
300
300
@@ -336,9 +336,9 @@ body > div > div { padding: 20px; }
336
336
337
337
</Solution>
338
338
339
-
#### Extract information into an object {/*extract-information-into-an-object*/}
339
+
#### استخرج المعلومات إلى كائن {/*extract-information-into-an-object*/}
340
340
341
-
Extract the image URL into the `person` object.
341
+
استخرج عنوان URL للصورة إلى كائن `person`.
342
342
343
343
<Sandpack>
344
344
@@ -380,7 +380,7 @@ body > div > div { padding: 20px; }
380
380
381
381
<Solution>
382
382
383
-
Move the image URL into a property called `person.imageUrl` and read it from the `<img>` tag using the curlies:
383
+
قم بنقل عنوان URL للصورة إلى خاصية تسمى`person.imageUrl`وقم بقراءتها من وسم `<img>`باستخدام الأقواس المعقوفة:
384
384
385
385
<Sandpack>
386
386
@@ -423,13 +423,13 @@ body > div > div { padding: 20px; }
423
423
424
424
</Solution>
425
425
426
-
#### Write an expression inside JSX curly braces {/*write-an-expression-inside-jsx-curly-braces*/}
426
+
#### اكتب تعبيراً داخل أقواس JSX المعقوفة. {/*write-an-expression-inside-jsx-curly-braces*/}
427
427
428
-
In the object below, the full image URL is split into four parts: base URL, `imageId`, `imageSize`, and file extension.
428
+
في الكائن أدناه، يتم تقسيم العنوان الكامل للصورة إلى أربعة أجزاء: العنوان الأساس و`imageId` و`imageSize` وامتداد الملف.
429
429
430
-
We want the image URL to combine these attributes together: base URL (always`'https://i.imgur.com/'`), `imageId` (`'7vQD0fP'`), `imageSize` (`'s'`), and file extension (always`'.jpg'`). However, something is wrong with how the `<img>`tag specifies its `src`.
430
+
نريد أن يتم دمج عنوان URL للصورة باستخدام هذه الخصائص معًا: العنوان الأساس (دائمًا `'https://i.imgur.com/'`) و`imageId` (`'7vQD0fP'`) و `imageSize` (`'s'`)، وامتداد الملف (دائمًا `'.jpg'`). ومع ذلك، هناك خطأ في كيفية تحديد الوسم `<img>` لخاصية `src` الخاصة به.
431
431
432
-
Can you fix it?
432
+
هل يمكنك إصلاح الخطأ؟
433
433
434
434
<Sandpack>
435
435
@@ -473,15 +473,15 @@ body > div > div { padding: 20px; }
473
473
474
474
</Sandpack>
475
475
476
-
To check that your fix worked, try changing the value of `imageSize` to `'b'`. The image should resize after your edit.
476
+
للتحقق من نجاح حلك، جرب تغيير قيمة `imageSize`إلى`'b'`. يفترض أن يتغير حجم الصورة بعد تعديلك.
477
477
478
478
<Solution>
479
479
480
-
You can write it as `src={baseUrl + person.imageId + person.imageSize + '.jpg'}`.
480
+
يمكنك كتابته على هذا النحو`src={baseUrl + person.imageId + person.imageSize + '.jpg'}`.
0 commit comments