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
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -209,38 +209,38 @@ function Profile() {
209
209
210
210
<DeepDive>
211
211
212
-
#### Components all the way down {/*components-all-the-way-down*/}
212
+
#### استفاده از کامپوننت ها {/*components-all-the-way-down*/}
213
213
214
214
اپلیکیشن ریکتی شما از کامپوننت `root` شروع میشود. معمولا زمانی که یک پروژه جدید میسازید این کامپوننت ساخته میشود, مثلا اگر شما از [CodeSandbox](https://codesandbox.io/) یا [Create React App](https://create-react-app.dev/) استفاده میکنید, به طور پیش فرض داخل `src/App.js` تعریف شده. اگر از فریمورک [Next.js](https://nextjs.org/) استفاده میکنید, کامپوننت `root` داخل `pages/index.js` تعریف شده است.
215
215
216
-
Most React apps use components all the way down. This means that you won't only use components for reusable pieces like buttons, but also for larger pieces like sidebars, lists, and ultimately, complete pages! Components are a handy way to organize UI code and markup, even if some of them are only used once.
216
+
اکثر برنامه های ریکتی از کامپوننت استفاده میکنند. به این معنی است که نه تنها از کامپوننت ها برای بخش های کوچکی مانند دکمه استفاده میکنیم, بلکه برای بخش های بزرگتری مانند منو ها یا لیست ها استفاده میکنیم. درکل از کامپوننت ها برای سازماندهی صفحات استفاده میکنیم.
217
217
218
-
[React-based frameworks](/learn/start-a-new-react-project)take this a step further. Instead of using an empty HTML file and letting React "take over" managing the page with JavaScript, they *also* generate the HTML automatically from your React components. This allows your app to show some content before the JavaScript code loads.
218
+
[React-based frameworks](/learn/start-a-new-react-project)کار مارا جلوتر میاندازد. بجای اینکه فایل های HTML برای صفحات سایت تعریف کنیم, با استفاده از فایل های جاوااسکریپتی صفحات را توسعه میدهیم و آنهارا مدیریت میکنیم.
219
219
220
-
Still, many websites only use React to [add interactivity to existing HTML pages.](/learn/add-react-to-an-existing-project#using-react-for-a-part-of-your-existing-page)They have many root components instead of a single one for the entire page. You can use as much—or as little—React as you need.
220
+
همچنان بسیاری از وبسایت ها از React برای [اضافه کردن تعامل در صفحه فعلی.](/learn/add-react-to-an-existing-project#using-react-for-a-part-of-your-existing-page)استفاده میشود. انها بجای یک کامپوننت ریشه از کامپوننت بیشتر و ریزتری استفاده کردند. شما میتوانید هرچقدر که نیاز دارید از کتابخانه ریکت استفاده کنید.
221
221
222
222
</DeepDive>
223
223
224
224
<Recap>
225
225
226
-
You've just gotten your first taste of React! Let's recap some key points.
226
+
شما اکنون برای اولین بار طعم React را چشیده اید! اجازه بدهید یکسری موارد را درباره آن مرور کنیم:
227
227
228
-
*React lets you create components, **reusable UI elements for your app.**
229
-
*In a React app, every piece of UI is a component.
230
-
*React components are regular JavaScript functions except:
228
+
*ریکت به شما اجازه میدهد کامپوننت های خود را, **که اجزایی هستند که میتوان چندین بار داخل اپلیکیشن استفاده کرد .** را توسعه دهید.
229
+
*در یک اپلیکیشن ریکتی, هر جایی از صفحه (دراینجا رابط کاربری) یک کامپوننت است.
230
+
*کامپوننت های ریکتی درواقع توابع معمولی جاوااسکریپتی هستند. البته باید :
231
231
232
-
1.Their names always begin with a capital letter.
233
-
2.They return JSX markup.
232
+
1.اسم آنها با حروف بزرگ شروع شود.
233
+
2.کد JSX برگردانند.
234
234
235
235
</Recap>
236
236
237
237
238
238
239
239
<Challenges>
240
240
241
-
#### Export the component {/*export-the-component*/}
241
+
#### خروجی گرفتن (export) از کامپوننت {/*export-the-component*/}
242
242
243
-
This sandbox doesn't work because the root component is not exported:
243
+
کد زیر قاعدتا کار نخواهد کرد. چون کامپوننت اصلی (root) را اکسپورت نکرده ایم:
244
244
245
245
<Sandpack>
246
246
@@ -261,7 +261,7 @@ img { height: 181px; }
261
261
262
262
</Sandpack>
263
263
264
-
Try to fix it yourself before looking at the solution!
0 commit comments