-
Notifications
You must be signed in to change notification settings - Fork 57
Translate higher order components page #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translate higher order components page #95
Conversation
…o feature/higher-order-components
Deploy preview for he-reactjs ready! Built with commit 50e0d4a |
// ... and renders the wrapped component with the fresh data! | ||
// Notice that we pass through any additional props | ||
// ... ומרנדרת את הקומפוננטה העטופה עם המידע החדש | ||
// הלאה props-שימו לב שאנחנו מעבירים את כל ה |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// הלאה props-שימו לב שאנחנו מעבירים את כל ה | |
// שימו לב שאנחנו מעבירים את כל ה-props הלאה |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This correction breaks the sentence when viewed in the browser, for some reason in comments the sentence order from right-to-left is different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you take the suggested sentence and paste it on a program like Word or even in the browser search bar and see if it shows correctly? In my experience GitHub breaks these sentences but they appear fine in the docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you're right I checked here and it displays correctly 👍
|
||
```js | ||
render() { | ||
// Filter out extra props that are specific to this HOC and shouldn't be | ||
// passed through | ||
// שלא אמורים לעבור הלאה לקומפוננטה העטופה HOC-הקשורים ל props-קודם כל נמצא את ה |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// שלא אמורים לעבור הלאה לקומפוננטה העטופה HOC-הקשורים ל props-קודם כל נמצא את ה | |
// קודם כל נמצא את ה-props הקשורים ל-HOC ושלא אמורים לעבור הלאה לקומפוננטה העטופה |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here @galnir
const injectedProp = someStateOrInstanceMethod; | ||
|
||
// Pass props to wrapped component | ||
// לקומפוננטה העטופה props-ועכשיו נוכל להעביר את ה |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// לקומפוננטה העטופה props-ועכשיו נוכל להעביר את ה | |
// ועכשיו נוכל להעביר את ה-props לקומפוננטה העטופה |
const enhance = connect(commentListSelector, commentListActions); | ||
// The returned function is a HOC, which returns a component that is connected | ||
// to the Redux store | ||
// Redux store-שמחזירה קומפוננטה שמחוברת ל ,HOC הפונקציה המוחזרת היא |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Redux store-שמחזירה קומפוננטה שמחוברת ל ,HOC הפונקציה המוחזרת היא | |
// הפונקציה המוחזרת היא HOC, שמחזירה קומפוננטה שמחוברת ל- Redux store |
|
||
```js | ||
render() { | ||
// A new version of EnhancedComponent is created on every render | ||
// נוצרות בכל רינדור EnhancedComponent גרסה חדשה של |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// נוצרות בכל רינדור EnhancedComponent גרסה חדשה של | |
// גרסה חדשה של EnhancedComponent נוצרת בכל רינדור |
WrappedComponent.staticMethod = function() {/*...*/} | ||
// Now apply a HOC | ||
// על הקומפוננטה HOC-עכשיו נשתמש ב |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// על הקומפוננטה HOC-עכשיו נשתמש ב | |
// עכשיו נשתמש ב- HOC על הקומפוננטה |
|
||
While the convention for higher-order components is to pass through all props to the wrapped component, this does not work for refs. That's because `ref` is not really a prop — like `key`, it's handled specially by React. If you add a ref to an element whose component is the result of a HOC, the ref refers to an instance of the outermost container component, not the wrapped component. | ||
למרות שהמוסכמה לקומפוננטות מסדר גבוה יותר היא להעביר את כל ה- props הלאה לקומפוננטה העטופה, זה לא עובד עבור רפרנסים (refs). הסיבה לכך היא שה- `ref` הוא לא בדיוק prop - כמו `key`, React מטפלת בו באופן מיוחד. אם תוסיפו רפרנס לאלמנט שהקומפוננטה שלו נוצרה על ידי HOC, הרפרנס מתייחס למופע הקומפוננטה המכילה החיצונית ביותר, ולא לקומפוננטה העטופה. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
למרות שהמוסכמה לקומפוננטות מסדר גבוה יותר היא להעביר את כל ה- props הלאה לקומפוננטה העטופה, זה לא עובד עבור רפרנסים (refs). הסיבה לכך היא שה- `ref` הוא לא בדיוק prop - כמו `key`, React מטפלת בו באופן מיוחד. אם תוסיפו רפרנס לאלמנט שהקומפוננטה שלו נוצרה על ידי HOC, הרפרנס מתייחס למופע הקומפוננטה המכילה החיצונית ביותר, ולא לקומפוננטה העטופה. | |
למרות שהמוסכמה לקומפוננטות מסדר גבוה יותר היא להעביר את כל ה- props הלאה לקומפוננטה העטופה, זה לא עובד עבור רפרנסים (refs). הסיבה לכך היא שה- `ref` הוא לא בדיוק prop - כמו React, 'key' מטפלת בו באופן מיוחד. אם תוסיפו רפרנס לאלמנט שהקומפוננטה שלו נוצרה על ידי HOC, הרפרנס מתייחס למופע הקומפוננטה המכילה החיצונית ביותר, ולא לקומפוננטה העטופה. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also seems to break the sentence order in the browser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor changes
Translation for Advanced - Higher order components page