Skip to content

Commit d8c2029

Browse files
committed
translate section component inside component
1 parent c3199de commit d8c2029

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,19 +170,19 @@ img { margin: 0 10px 10px 0; height: 90px; }
170170
</section>
171171
```
172172

173-
### Nesting and organizing components {/*nesting-and-organizing-components*/}
173+
### قرار دادن کامپوننت داخل یک کامپوننت دیگر {/*nesting-and-organizing-components*/}
174174

175-
Components are regular JavaScript functions, so you can keep multiple components in the same file. This is convenient when components are relatively small or tightly related to each other. If this file gets crowded, you can always move `Profile` to a separate file. You will learn how to do this shortly on the [page about imports.](/learn/importing-and-exporting-components)
175+
کامپوننت ها درواقع فانکشن های معمولی جاوااسکریپت هستند, پس شما میتوانید در یک فایل چند کامپوننت تعریف کنید که معمولا زمانی استفاده میشود که کامپوننت ها نسبتا کوچک یا باهم ربطی داشته باشند و اگر فایل شلوغ شد آنها را در فایل های جداگانه ای قرار بدهید. درباره انجام دادن آن و [دستور Import](/learn/importing-and-exporting-components) میتوانید مطالعه کنید.
176176

177-
Because the `Profile` components are rendered inside `Gallery`—even several times!—we can say that `Gallery` is a **parent component,** rendering each `Profile` as a "child". This is part of the magic of React: you can define a component once, and then use it in as many places and as many times as you like.
177+
چون کامپوننت `Profile` داخل کامپوننت `Gallery` هست و چند باری هم تکرار شده, بنابراین کامپوننت `Gallery` یک کامپوننت والد یا **parent component** که کامپوننت `Gallery` که فرزندان خودش هست را اجرا یا رندر گیری میکند. این بخشی از جادو ریکت است: که میتوانید کامپوننت را یکبار تعریف کنید و هرچند باری که لازم داشتید صدا بزنید.
178178

179179
<Pitfall>
180180

181-
Components can render other components, but **you must never nest their definitions:**
181+
کامپوننت ها میتوانند کامپوننت های داختلی خود را رندر بگیرند, اما **به هیچ وجه کامپوننت هارا تودرتو تعریف نکنید:**
182182

183183
```js {2-5}
184184
export default function Gallery() {
185-
// 🔴 Never define a component inside another component!
185+
// 🔴 به هیچ وجه کامپوننتی داخل یک کامپوننت تعریف نشود
186186
function Profile() {
187187
// ...
188188
}

0 commit comments

Comments
 (0)