Skip to content

Commit a0a8f0b

Browse files
committed
complete your first component page translation
1 parent a0bf8eb commit a0a8f0b

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

src/content/learn/your-first-component.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ img { height: 181px; }
265265

266266
<Solution>
267267

268-
Add `export default` before the function definition like so:
268+
دستور `export default` را قبل از تابع اضافه کنید, مانند مثال زیر:
269269

270270
<Sandpack>
271271

@@ -286,17 +286,18 @@ img { height: 181px; }
286286

287287
</Sandpack>
288288

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) بخوانید
290290

291291
</Solution>
292292

293-
#### Fix the return statement {/*fix-the-return-statement*/}
293+
#### رفع مشکل دستور return {/*fix-the-return-statement*/}
294294

295-
Something isn't right about this `return` statement. Can you fix it?
295+
296+
عبارت `return` در این کد اشتباه است. میتونی درستش کنی؟!
296297

297298
<Hint>
298299

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 ( )` باشد. درغیراینصورت به ارور برخورد میکنید.
300301

301302
</Hint>
302303

@@ -318,7 +319,7 @@ img { height: 180px; }
318319

319320
<Solution>
320321

321-
You can fix this component by moving the return statement to one line like so:
322+
برای رفع مشکل این کامپوننت, میتوانید دستور JSX را در یک خط تایپ کنید:
322323

323324
<Sandpack>
324325

@@ -334,7 +335,7 @@ img { height: 180px; }
334335

335336
</Sandpack>
336337

337-
Or by wrapping the returned JSX markup in parentheses that open right after `return`:
338+
یا دستور JSX را مابین پرانتز باز و بسته بعد از `return` قرار بدهید:
338339

339340
<Sandpack>
340341

@@ -359,7 +360,7 @@ img { height: 180px; }
359360

360361
#### Spot the mistake {/*spot-the-mistake*/}
361362

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 اشتباه گرفته!
363364

364365
<Sandpack>
365366

@@ -393,9 +394,9 @@ img { margin: 0 10px 10px 0; height: 90px; }
393394

394395
<Solution>
395396

396-
React component names must start with a capital letter.
397+
نامگذاری کامپونت های ریکتی حتما باید با حرف بزرگ شروع شود!
397398

398-
Change `function profile()` to `function Profile()`, and then change every `<profile />` to `<Profile />`:
399+
دستور `function profile()` را به `function Profile()` تغییر دهید, سپس `<profile />` را `<Profile />` تغییر دهید:
399400

400401
<Sandpack>
401402

@@ -429,14 +430,14 @@ img { margin: 0 10px 10px 0; }
429430

430431
</Solution>
431432

432-
#### Your own component {/*your-own-component*/}
433+
#### یک کامپوننت بسازید! {/*your-own-component*/}
433434

434-
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 کنید!
435436

436437
<Sandpack>
437438

438439
```js
439-
// Write your component below!
440+
// اینجا کامپوننت خود را بنویسید
440441

441442
```
442443

0 commit comments

Comments
 (0)