Examples of using
Useeffect
in Hebrew and their translations into English
{-}
Colloquial
Ecclesiastic
Computer
Programming
הבה נראה כיצד נוכל לעשות את אותו הדבר עם useEffect.
Now let's see how we can do the same with the useEffect Hook.
UseEffect(updateTitle)// 4. הוספת אפקט על מנת לעדכן את הכותרת.
UseEffect(updateTitle)// 4. Add an effect for updating the title.
יש לו את אותה חתימה כ-useEffect, ושונה ממנו כשהוא נורה.
It has the same signature as useEffect, and only differs in when it is fired.
על מנת לעשותזאת, העבר מערך כארגומנט שני אופציונאלי ל- useEffect.
To do so,pass an array as an optional second argument to useEffect.
תוכל ללמוד עוד על useEffect בעמוד ייעודי: שימוש ב-Effect Hook.
You can learn more about useEffect on a dedicated page: Using the Effect Hook.
דרישה זו היא נפוצה מספיק שהיא כבר בנויה לתוך useEffect.
This requirement is common enough that it is built into the useEffect Hook API.
על מנת לעשות זאת, הפונקציה המועברת ל-useEffect תחזיר פונקציית נקיון.
To do this, the function passed to useEffect may return a clean-up function.
הפונקציה המועברת ל-useEffect תרוץ אחרי שהרינדור מופיע על המסך.
The function passed to useEffect will run after the render is committed to the screen.
אין קוד מיוחד לטיפול בעדכונים בגלל ש- useEffect מטפלת בהם כברירת מחדל.
There is no special code for handling updates because useEffect handles them by default.
מאפיין זה זהה ל-useEffect, אבל הוא יורה באופן סינכרוני לאחר כל שינויי DOM.
The signature is identical to useEffect, but it fires synchronously after all DOM mutations.
על מנת ליישם זאת, העבר ארגומנט שני ל-useEffect שהוא מערך של ערכים שהאפקט תלוי בהם.
To implement this, pass a second argument to useEffect that is the array of values that the effect depends on.
ה-Effect Hook, useEffect, מוסיף את היכולת לבצע תופעות לוואי מתוך קומפוננטת פונקציה.
The Effect Hook, useEffect, adds the ability to perform side effects from a function component.
לעומת זאת, אנו ממליצים להתחיל עם useEffect קודם ולנסות את useLayoutEffect רק אם זה יוצר בעיה.
However, we recommend starting with useEffect first and only trying useLayoutEffect if that causes a problem.
למדנו ש- useEffect נותן לנו להביע סוגים שונים של תופעות לוואי לאחר רינדור קומפוננטה.
We have learned that useEffect lets us express different kinds of side effects after a component renders.
זה מה שמאפשר לריאקט לשמור את ה-state של Hooks בין קריאות מרובות של useState ו- useEffect.
That's what allows React to correctlypreserve the state of Hooks between multiple useState and useEffect calls.
אף על פי ש-useEffect מתעכב על שהדפדפן נצבע, זה מובטח שהוא נורה לפני רינדורים חדשים.
Although useEffect is deferred until after the browser has painted, it's guaranteed to fire before any new renders.
אולם קוד שמיועדלהוספה ולהסרה של subscription כל כך קשור ש- useEffect מתוכנן להשאיר אותו ביחד.
But code for adding andremoving a subscription is so tightly related that useEffect is designed to keep it together.
הצבת useEffect בתוך הקומפוננטה נותנת לנו גישה למשתנה- count state(או כל prop אחר) ישר מה-effect.
Placing useEffect inside the component lets us access the count state variable(or any props) right from the effect.
בגלל שאנו קוראים ל-useFriendStatusישירות, מנקודת המבט של React הקומפוננטה שלנו קוראת ל-useState ו-useEffect.
Because we call useFriendStatus directly,from React's point of view our component just calls useState and useEffect.
נמשיך את עמוד זה עם מבט מעמיק על כמה מההיבטים של useEffect שיכולים לעניין משתמשי ריאקט מנוסים.
We will continue this page with an in-depth look at some aspects of useEffect that experienced React users will likely be curious about.
על מנת לתקן זאת, או שתעביר את הלוגיקה ל-useEffect(אם זה לא נחוץ לרינדור הראשון), או המתן עם הצגת הקומפוננטה עד לאחר רינדור הקליינט(אם ה-HTML נראה שבור עד ש-useLayoutEffect רץ).
To fix this, either move that logic to useEffect(if it isn't necessary for the first render), or delay showing that component until after the client renders(if the HTML looks broken until useLayoutEffect runs).
אם אתה משתמש ב-server rendering,שים לב שגם useLayoutEffect וגם useEffect יכולים לרוץ עד שהג'אווהסקריפט הורד.
If you use server rendering,keep in mind that neither useLayoutEffect nor useEffect can run until the JavaScript is downloaded.
מפתחי ג'אווהסקריפט מנוסים אולי ישימו לב שהפונקציה שמועברת ל- useEffect הולכת להיות שונה לכל רינדור. זה נעשה בכוונה.
Experienced JavaScript developers might notice that the function passed to useEffect is going to be different on every render. This is intentional.
בשונה מ-componentDidMount ו-componentDidUpdate, הפונקציה שמועברת ל-useEffect נורה לאחר פריסה וצביעה(layout and paint), בזמן אירוע נדחה.
Unlike componentDidMount and componentDidUpdate, the function passed to useEffect fires after layout and paint, during a deferred event.
בניגוד ל- componentDidMount או componentDidUpdate, effects שמתוזמנים עם useEffect לא חוסמים את הדפדפן מלעדכן את המסך.
Unlike componentDidMount or componentDidUpdate, effects scheduled with useEffect don't block the browser from updating the screen.
וכמו שלמדנו קודם, אנו יכולים לקרוא ל-useState ו-useEffect פעמים רבות בקומפוננטה אחת, והם יהיו עצמאים לגמרי.
And as we learned earlier, we can call useState and useEffect many times in one component, and they will be completely independent.
מוקדם יותר בעמוד זה,הצגנו את קומפוננטה FriendStatus שקוראת ל-useState ו-useEffect על מנת לעשות subscribe לסטטוס חיבור אונליין של חבר.
Earlier on this page,we introduced a FriendStatus component that calls the useState and useEffect Hooks to subscribe to a friend's online status.
אם יש לך נסיון עם מתודות מחזור חיים במחלקות ריאקט,אתה יכול לחשוב על useEffect כ- componentDidMount, componentDidUpdate, ו- componentWillUnmount משולבות.
If you're familiar with React class lifecycle methods,you can think of useEffect Hook as componentDidMount, componentDidUpdate, and componentWillUnmount combined.
עִברִית
عربى
Български
বাংলা
Český
Dansk
Deutsch
Ελληνικά
Español
Suomi
Français
हिंदी
Hrvatski
Magyar
Bahasa indonesia
Italiano
日本語
Қазақ
한국어
മലയാളം
मराठी
Bahasa malay
Nederlands
Norsk
Polski
Português
Română
Русский
Slovenský
Slovenski
Српски
Svenska
தமிழ்
తెలుగు
ไทย
Tagalog
Turkce
Українська
اردو
Tiếng việt
中文