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: content/docs/components-and-props.md
+4-11Lines changed: 4 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,21 +74,14 @@ const element = <Welcome name="Sara" />;
74
74
root.render(element);
75
75
```
76
76
77
-
**[Try it on CodePen](https://codepen.io/gaearon/pen/YGYmEG?editors=1010)**
77
+
**[נסו את זה ב-codepen](https://codepen.io/gaearon/pen/YGYmEG?editors=1010)**
78
78
79
79
בואו נסכם מה קורה בדוגמה זו:
80
80
81
-
<<<<<<< HEAD
82
81
1. אנחנו קוראים ל-`ReactDOM.render()` עם האלמנט `<Welcome name="Sara" />`.
83
82
2. React קוראת לקומפוננטת `Welcome` עם `{name: 'Sara'}` בתור ה-props.
84
83
3. קומפוננטת `Welcome` שלנו מחזירה אלמנט `<h1>Hello, Sara</h1>` בתור התוצאה שלה.
85
84
4. React DOM מעדכן ביעילות את ה-DOM להיות תואם ל-`<h1>Hello, Sara</h1>`.
86
-
=======
87
-
1. We call `root.render()` with the `<Welcome name="Sara" />` element.
88
-
2. React calls the `Welcome` component with `{name: 'Sara'}` as the props.
89
-
3. Our `Welcome` component returns a `<h1>Hello, Sara</h1>` element as the result.
90
-
4. React DOM efficiently updates the DOM to match `<h1>Hello, Sara</h1>`.
91
-
>>>>>>> 84ad3308338e2bb819f4f24fa8e9dfeeffaa970b
92
85
93
86
>**הערה:** יש להתחיל שמות קומפוננטות עם אות גדולה.
94
87
>
@@ -118,7 +111,7 @@ function App() {
118
111
}
119
112
```
120
113
121
-
**[Try it on CodePen](https://codepen.io/gaearon/pen/KgQKPr?editors=1010)**
114
+
**[נסו את זה ב-codepen](https://codepen.io/gaearon/pen/KgQKPr?editors=1010)**
122
115
123
116
בדרך כלל, אפליקציות React חדשות כוללות קומפוננטת `App` אחת בראש האפליקציה. עם זאת, אם תשלבו את React באפליקציה קיימת, תוכלו להתחיל מלמטה למעלה באמצעות קומפוננטה קטנה כגון `Button`, ובהדרגה להגיע לחלק העליון ביותר של הירארכיית התצוגה.
124
117
@@ -152,7 +145,7 @@ function Comment(props) {
152
145
}
153
146
```
154
147
155
-
**[Try it on CodePen](https://codepen.io/gaearon/pen/VKQwEo?editors=1010)**
148
+
**[נסו את זה ב-codepen](https://codepen.io/gaearon/pen/VKQwEo?editors=1010)**
156
149
157
150
היא מקבלת את `author` (אובייקט), `text` (מחרוזת) ו-`date` (תאריך) בתור props, ומתארת תגובה באתר אינטרנט של מדיה חברתית.
158
151
@@ -231,7 +224,7 @@ function Comment(props) {
231
224
}
232
225
```
233
226
234
-
**[Try it on CodePen](https://codepen.io/gaearon/pen/rrJNJY?editors=1010)**
227
+
**[נסו את זה ב-codepen](https://codepen.io/gaearon/pen/rrJNJY?editors=1010)**
235
228
236
229
חילוץ קומפוננטות אולי נראה כמו עבודה שחורה בהתחלה, אבל בעלות על מגוון קומפוננטות לשימוש חוזר משתלמת באפליקציות גדולות יותר. כלל אצבע טוב הוא שאם חלק מממשק המשתמש שלכם נמצא בשימוש מספר פעמים (`Button`, `Panel`, `Avatar`), או שהוא מורכב מספיק בכוחות עצמו (`App`, `FeedStory`, `Comment`), הוא מועמד טוב להיות מחולץ לקומפוננטה אחרת.
Copy file name to clipboardExpand all lines: content/docs/introducing-jsx.md
+1-6Lines changed: 1 addition & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,18 +33,13 @@ React [לא דורשת](/docs/react-without-jsx.html) שימוש ב-JSX, אבל
33
33
בדוגמה הבאה, אנו מכריזים על משתנה הנקרא `name` (שם) ולאחר מכן משתמשים בו בתוך JSX על ידי עטיפתו בסוגריים מסולסלים:
34
34
35
35
```js{1,2}
36
-
<<<<<<< HEAD
37
36
const name = 'גיא פרץ';
38
37
const element = <h1>שלום, {name}</h1>;
39
38
40
39
ReactDOM.render(
41
40
element,
42
41
document.getElementById('root')
43
42
);
44
-
=======
45
-
const name = 'Josh Perez';
46
-
const element = <h1>Hello, {name}</h1>;
47
-
>>>>>>> 84ad3308338e2bb819f4f24fa8e9dfeeffaa970b
48
43
```
49
44
50
45
ניתן לשים כל [ביטוי JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#Expressions) חוקי בתוך סוגריים מסולסלים ב-JSX. לדוגמה, `2 + 2`, `user.firstName`, או `formatName(user)` הם כולם ביטויים חוקיים ב-JavaScript.
@@ -68,7 +63,7 @@ const element = (
68
63
);
69
64
```
70
65
71
-
**[Try it on CodePen](https://codepen.io/gaearon/pen/PGEjdG?editors=1010)**
66
+
**[נסו את זה ב-codepen](https://codepen.io/gaearon/pen/PGEjdG?editors=1010)**
72
67
73
68
אנו מפצלים את JSX על מספר שורות עבור הקריאות. אף על פי שזה לא נדרש, כאשר עושים זאת, אנו ממליצים גם לעטוף אותו בסוגריים כדי למנוע את החסרונות של [הכנסת נקודה-פסיק אוטומטית](https://stackoverflow.com/q/2846283).
Copy file name to clipboardExpand all lines: content/docs/rendering-elements.md
+2-24Lines changed: 2 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,60 +34,38 @@ Unlike browser DOM elements, React elements are plain objects, and are cheap to
34
34
35
35
בדרך כלל, אפליקציות הנבנות עם ריאקט הן בעלות קודקוד DOM שורשי אחד. במידה ואתה משלב את ריאקט לתוך אפליקציה קיימת, אתה יכול להשתמש בכמות בלתי מוגבלת של קודקודי DOM שורשיים.
36
36
37
-
<<<<<<< HEAD
38
37
על מנת לצייר אלמנט ריאקטי לתוך קודקוד DOM שורשי, העבר אותם אל הפונקציה [`ReactDOM.render()`](/docs/react-dom.html#render):
39
-
=======
40
-
To render a React element, first pass the DOM element to [`ReactDOM.createRoot()`](/docs/react-dom-client.html#createroot), then pass the React element to `root.render()`:
41
-
>>>>>>> 84ad3308338e2bb819f4f24fa8e9dfeeffaa970b
42
-
43
38
`embed:rendering-elements/render-an-element.js`
44
39
45
-
**[Try it on CodePen](https://codepen.io/gaearon/pen/ZpvBNJ?editors=1010)**
40
+
**[נסו את זה ב-codepen](https://codepen.io/gaearon/pen/ZpvBNJ?editors=1010)**
46
41
47
42
דוגמא זו מציגה "Hello, world" בעמוד.
48
43
49
44
## עדכון אלמנטים שצוירו {#updating-the-rendered-element}
50
45
51
46
אלמנטי ריאקט [אינם משתנים](https://en.wikipedia.org/wiki/Immutable_object). במידה ויצרת אלמנט, לא ניתן לשנות את ילדיו או מאפייניו. אלמנט הוא כמו פרים יחיד בסרט: הוא מייצג את ממשק המשתמש בנקודה מסויימת בזמן.
52
47
53
-
<<<<<<< HEAD
54
48
עם הידע שלמדנו על כה, הדרך היחידה לעדכן את ממשק המשתמש הוא על ידי יצירה של אלמנט חדש והעברה שלו ל[`ReactDOM.render()`](/docs/react-dom.html#render).
55
-
=======
56
-
With our knowledge so far, the only way to update the UI is to create a new element, and pass it to `root.render()`.
**[Try it on CodePen](https://codepen.io/gaearon/pen/gwoJZk?editors=1010)**
54
+
**[נסו את זה ב-codepen](https://codepen.io/gaearon/pen/gwoJZk?editors=1010)**
64
55
65
-
<<<<<<< HEAD
66
56
דוגמא זו קוראת ל[`ReactDOM.render()`](/docs/react-dom.html#render) בכל שניה על ידי הפונקציה הנקראת על ידי [`setInterval()`](https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval).
67
-
=======
68
-
It calls [`root.render()`](/docs/react-dom.html#render) every second from a [`setInterval()`](https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval) callback.
69
-
>>>>>>> 84ad3308338e2bb819f4f24fa8e9dfeeffaa970b
70
57
71
58
>**הערה:**
72
59
>
73
-
<<<<<<< HEAD
74
60
>בפועל, רוב אפליקציות ריאקט קוראות ל[`ReactDOM.render()`](/docs/react-dom.html#render) פעם אחת בלבד. בפרקים הבאים נלמד איך קוד כזה מוכמס ל[קומפוננטות בעלות state](/docs/state-and-lifecycle.html).
75
-
76
-
=======
77
-
>In practice, most React apps only call `root.render()` once. In the next sections we will learn how such code gets encapsulated into [stateful components](/docs/state-and-lifecycle.html).
78
-
>>>>>>> 84ad3308338e2bb819f4f24fa8e9dfeeffaa970b
79
61
>
80
62
>אנו ממליצים לא לדלג על נושאים מכיוון שהם נבנו אחד על השני.
81
63
82
64
## ריאקט מעדכן רק מה שנחוץ לעדכן {#react-only-updates-whats-necessary}
83
65
84
66
React DOM משווה את האלמנט וילדיו למצב הקודם שלו ומחיל אך ורק שינויים נדרשים בDOM על מנת להביא אותו למצב הרצוי.
85
67
86
-
<<<<<<< HEAD
87
68
אתה יכול לאמת זאת על ידי התבוננות [בדוגמא](codepen://rendering-elements/update-rendered-element) באמצעות כלי הדפדפן:
88
-
=======
89
-
You can verify by inspecting the [last example](https://codepen.io/gaearon/pen/gwoJZk?editors=1010) with the browser tools:
90
-
>>>>>>> 84ad3308338e2bb819f4f24fa8e9dfeeffaa970b
91
69
92
70

Copy file name to clipboardExpand all lines: content/docs/state-and-lifecycle.md
-8Lines changed: 0 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,7 @@ next: handling-events.html
10
10
11
11
דף זה מציג את הקונספט של state ומחזור חיים בקומפוננטת React. תוכלו למצוא את [פירוט ה-API של קומפוננטה כאן](/docs/react-component.html).
12
12
13
-
<<<<<<< HEAD
14
13
הביטו על דוגמת השעון המתקתק מ[אחד מהחלקים הקודמים](/docs/rendering-elements.html#updating-the-rendered-element). ב[רינדור אלמנטים](/docs/rendering-elements.html#rendering-an-element-into-the-dom), למדנו רק דרך אחת לעדכון ממשק המשתמש. אנו קוראים ל-`ReactDOM.render()` כדי לשנות את הפלט שירונדר:
15
-
=======
16
-
Consider the ticking clock example from [one of the previous sections](/docs/rendering-elements.html#updating-the-rendered-element). In [Rendering Elements](/docs/rendering-elements.html#rendering-an-element-into-the-dom), we have only learned one way to update the UI. We call `root.render()` to change the rendered output:
בואו נסכם בזריזות את מה שקורה ואת הסדר שבו מתודות נקראות:
300
296
301
-
<<<<<<< HEAD
302
297
1) כאשר `<Clock />` מועבר ל-`ReactDOM.render()`, React קוראת לבנאי של הרכיב `Clock`. מכיוון ש-`Clock` צריך להציג את השעה הנוכחית, הוא מאתחל את `this.state` עם אובייקט שכולל את הזמן הנוכחי. בהמשך נעדכן את ה-state הזה.
303
-
=======
304
-
1) When `<Clock />` is passed to `root.render()`, React calls the constructor of the `Clock` component. Since `Clock` needs to display the current time, it initializes `this.state` with an object including the current time. We will later update this state.
305
-
>>>>>>> 84ad3308338e2bb819f4f24fa8e9dfeeffaa970b
306
298
307
299
2) אז React קוראת למתודת `render()` של קומפוננטת ה-`Clock`. באופן זה React לומדת מה צריך להיות מוצג על המסך. אז React מעדכנת את ה-DOM כדי שיהיה תואם לפלט שרונדר על ידי `Clock`.
Copy file name to clipboardExpand all lines: content/docs/thinking-in-react.md
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
id: thinking-in-react
3
-
title: Thinking in React
3
+
title: חשיבה ב-React
4
4
permalink: docs/thinking-in-react.html
5
5
redirect_from:
6
6
- 'blog/2013/11/05/thinking-in-react.html'
@@ -67,11 +67,7 @@ React, לפי דעתנו, היא ספריית הג'וואה-סקריפט המו
67
67
68
68
נוכל לבנות מלמעלה למטה או מלמטה למעלה. שזה אומר שנוכל להתחיל לבנות את הקומפוננטות מלמעלה בהירככיה( נתחיל מFilterableProductTable ) או מהקומפוננטות התחתונות בהיררכיה( ProductRow ). בדוגמות פשוטות יותר, זה קל יותר להתחיל מלמעלה למטה, ובפרויקטים גדולים, זה קל יותר להתחיל מלמטה למעלה ולכתוב tests במקביל לבנייה.
69
69
70
-
<<<<<<< HEAD
71
70
בסוף השלב הזה, יהיה לנו ספרייה של קומפוננטות שמישות שמרנדרות את מודל המידע. הקומפוננטות יכילו רק מתודות render() מכיון שזוהי גרסה סטטית של היישום. הקומפוננטה בראש ההיררכיה(FilterableProductTable) תיקח את מודל המידע כprop שיועבר לה. אם נבצע שינוי למודל המידע ונקרא ל ReactDOM.render() שוב, ממשק המשתמש יעודכן. זה פשוט לראות איך ממשק המשתמש מעודכן והיכן לבצע שינויים מכיוון ששום דבר מסובך לא מתבצע. **העברת המידע בכיוון אחד** של React משאירה הכל בצורה מודולרית ומהירה.
72
-
=======
73
-
At the end of this step, you'll have a library of reusable components that render your data model. The components will only have `render()` methods since this is a static version of your app. The component at the top of the hierarchy (`FilterableProductTable`) will take your data model as a prop. If you make a change to your underlying data model and call `root.render()` again, the UI will be updated. You can see how your UI is updated and where to make changes. React's **one-way data flow** (also called *one-way binding*) keeps everything modular and fast.
74
-
>>>>>>> 84ad3308338e2bb819f4f24fa8e9dfeeffaa970b
75
71
76
72
קרא עוד ב[תיעוד של ריאקט](/docs/getting-started.html) אם תצטרך עזרה בביצוע שלב זה.
0 commit comments