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
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,11 +117,11 @@ export default function TodoList() {
117
117
1. **كنص** مباشرة داخل وسم JSX: `<h1>{name}'s قائمة المهام</h1>` يعمل، ولكن `<{tag}>قائمة المهام لـ Gregorio Y. Zara</{tag}>` لن يعمل.
118
118
2. **كخصائص** تأتي فورًا بعد علامة `=`: `src={avatar}` ستقرأ قيمة المتغير `avatar`، ولكن `src="{avatar}"` ستمرر `"{avatar}"` في صورة string.
119
119
120
-
## Using "double curlies": CSS and other objects in JSX {/*using-double-curlies-css-and-other-objects-in-jsx*/}
120
+
## استخدام "أقواس معقوفة مزدوجة": CSS وكائنات أخرى داخل JSX {/*using-double-curlies-css-and-other-objects-in-jsx*/}
121
121
122
-
In addition to strings, numbers, and other JavaScript expressions, you can even pass objects in JSX. Objects are also denoted with curly braces, like`{ name:"Hedy Lamarr", inventions:5 }`. Therefore, to pass a JS object in JSX, you must wrap the object in another pair of curly braces: `person={{ name:"Hedy Lamarr", inventions:5 }}`.
122
+
بالإضافة إلى strings والأرقام وتعابير JavaScript الأخرى، يمكنك تمرير الكائنات في JSX. يتم تمييز الكائنات أيضًا بواسطة الأقواس المعقوفة، مثل`{ name:"Hedy Lamarr", inventions:5 }`. لذلك، لتمرير كائن JavaScript في JSX، يجب عليك إحاطة الكائن بزوج آخر من الأقواس المعقوفة: `person={{ name:"Hedy Lamarr", inventions:5 }}`.
123
123
124
-
You may see this with inline CSS styles in JSX. React does not require you to use inline styles (CSS classes work great for most cases). But when you need an inline style, you pass an object to the `style` attribute:
124
+
قد ترى ذلك في أنماط CSS المضمنة في JSX. React لا تتطلب منك استخدام أنماط CSS مضمنة (صنف CSS يعمل جيداً في معظم الحالات). ولكن عندما تحتاج إلى أسلوب مضمن، يمكنك تمرير كائن إلى خاصية `style`:
125
125
126
126
<Sandpack>
127
127
@@ -147,9 +147,9 @@ ul { padding: 20px 20px 20px 40px; margin: 0; }
147
147
148
148
</Sandpack>
149
149
150
-
Try changing the values of `backgroundColor`and`color`.
150
+
حاول تغيير قيم `backgroundColor`و`color`.
151
151
152
-
You can really see the JavaScript object inside the curly braces when you write it like this:
152
+
يمكنك رؤية كائن JavaScript بوضوح داخل الأقواس المعقوفة عندما تكتبه بهذه الطريقة:
153
153
154
154
```js {2-5}
155
155
<ul style={
@@ -160,11 +160,11 @@ You can really see the JavaScript object inside the curly braces when you write
160
160
}>
161
161
```
162
162
163
-
The next time you see`{{`and`}}`in JSX, know that it's nothing more than an object inside the JSX curlies!
163
+
في المرة القادمة التي ترى`{{`و`}}`في JSX، أعلم أنه ليس سوى كائن داخل أقواس JSX المعقوفة!
164
164
165
165
<Pitfall>
166
166
167
-
Inline`style`properties are written in camelCase. For example, HTML `<ul style="background-color: black">`would be written as `<ul style={{ backgroundColor:'black' }}>` in your component.
167
+
خصائص`style`المضمنة تكتب بتنسيق camelCase. على سبيل المثال، عنصر HTML `<ul style="background-color: black">`يتم كتابته في المكون الخاص بك على النحو التالي: `<ul style={{ backgroundColor:'black' }}>`.
0 commit comments