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/your-first-component.md
+14-13Lines changed: 14 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -265,7 +265,7 @@ img { height: 181px; }
265
265
266
266
<Solution>
267
267
268
-
Add`export default`before the function definition like so:
268
+
دستور`export default`را قبل از تابع اضافه کنید, مانند مثال زیر:
269
269
270
270
<Sandpack>
271
271
@@ -286,17 +286,18 @@ img { height: 181px; }
286
286
287
287
</Sandpack>
288
288
289
-
You might be wondering why writing `export`alone is not enough to fix this example. You can learn the difference between `export`and`export default`in [Importing and Exporting Components.](/learn/importing-and-exporting-components)
289
+
شاید برایتان سوال باشد که تنها دستور `export`برای حل مشکل بالا کافی بود. شما میتوانید تفاوت های بین `export`و`export default`را در [import و export کردن یک کامپوننت](/learn/importing-and-exporting-components) بخوانید
290
290
291
291
</Solution>
292
292
293
-
#### Fix the return statement {/*fix-the-return-statement*/}
293
+
#### رفع مشکل دستور return {/*fix-the-return-statement*/}
294
294
295
-
Something isn't right about this `return` statement. Can you fix it?
295
+
296
+
عبارت `return` در این کد اشتباه است. میتونی درستش کنی؟!
296
297
297
298
<Hint>
298
299
299
-
You may get an "Unexpected token" error while trying to fix this. In that case, check that the semicolon appears *after* the closing parenthesis. Leaving a semicolon inside `return ( )`will cause an error.
300
+
شاید شما در حین رفع مشکل این دستور به ارور "Unexpected token" برخورد کرده باشید. توجه کنید که حتما سمی کالن بعد از پرانتز بسته `return ( )`باشد. درغیراینصورت به ارور برخورد میکنید.
300
301
301
302
</Hint>
302
303
@@ -318,7 +319,7 @@ img { height: 180px; }
318
319
319
320
<Solution>
320
321
321
-
You can fix this component by moving the return statement to one line like so:
322
+
برای رفع مشکل این کامپوننت, میتوانید دستور JSX را در یک خط تایپ کنید:
322
323
323
324
<Sandpack>
324
325
@@ -334,7 +335,7 @@ img { height: 180px; }
334
335
335
336
</Sandpack>
336
337
337
-
Or by wrapping the returned JSX markup in parentheses that open right after `return`:
338
+
یا دستور JSX را مابین پرانتز باز و بسته بعد از `return` قرار بدهید:
338
339
339
340
<Sandpack>
340
341
@@ -359,7 +360,7 @@ img { height: 180px; }
359
360
360
361
#### Spot the mistake {/*spot-the-mistake*/}
361
362
362
-
Something's wrong with how the `Profile` component is declared and used. Can you spot the mistake? (Try to remember how React distinguishes components from the regular HTML tags!)
363
+
کامپوننت `Profile` را در اینجا تعریف کردیم و زمانی که داریم استفاده میکنیم به ما خطا میدهد! به این معنا است که ریکت, کامپوننت را با یک تگ HTML اشتباه گرفته!
Write a component from scratch. You can give it any valid name and return any markup. If you're out of ideas, you can write a `Congratulations`component that shows `<h1>Good job!</h1>`. Don't forget to export it!
435
+
یک کامپوننتی را از پایه بنویسید. شما میتوانید هر اسمی را بدهید و هر JSX یی را return کنید. ایده ای ندارید؟ ابتدا یک کامپوننت با نام `Congratulations`بسازید و کاری کنید که کد JSX یی `<h1>Good job!</h1>` را برگرداند. فقط یادتان باشد حتما آن را export کنید!
0 commit comments