Skip to content

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

Merged
merged 12 commits into from
Aug 16, 2019

Conversation

rgrnwd
Copy link

@rgrnwd rgrnwd commented Jul 21, 2019

Translation for Advanced - Higher order components page

@netlify
Copy link

netlify bot commented Jul 21, 2019

Deploy preview for he-reactjs ready!

Built with commit 50e0d4a

https://deploy-preview-95--he-reactjs.netlify.com

@tesseralis tesseralis mentioned this pull request Jul 21, 2019
88 tasks
// ... and renders the wrapped component with the fresh data!
// Notice that we pass through any additional props
// ... ומרנדרת את הקומפוננטה העטופה עם המידע החדש
// הלאה props-שימו לב שאנחנו מעבירים את כל ה
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// הלאה props-שימו לב שאנחנו מעבירים את כל ה
// שימו לב שאנחנו מעבירים את כל ה-props הלאה

Copy link
Author

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.

Copy link
Collaborator

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have word (mac) - but in the browser bar it still shows as broken
Screen Shot 2019-08-15 at 10 09 34 pm

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the version I committed it looks like this (can you confirm it's the same in your browser?)
Screen Shot 2019-08-15 at 10 10 20 pm

Copy link
Collaborator

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-קודם כל נמצא את ה
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// שלא אמורים לעבור הלאה לקומפוננטה העטופה HOC-הקשורים ל props-קודם כל נמצא את ה
// קודם כל נמצא את ה-props הקשורים ל-HOC ושלא אמורים לעבור הלאה לקומפוננטה העטופה

Copy link
Author

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-ועכשיו נוכל להעביר את ה
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// לקומפוננטה העטופה 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 הפונקציה המוחזרת היא
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Redux store-שמחזירה קומפוננטה שמחוברת ל ,HOC הפונקציה המוחזרת היא
// הפונקציה המוחזרת היא HOC, שמחזירה קומפוננטה שמחוברת ל- Redux store


```js
render() {
// A new version of EnhancedComponent is created on every render
// נוצרות בכל רינדור EnhancedComponent גרסה חדשה של
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// נוצרות בכל רינדור EnhancedComponent גרסה חדשה של
// גרסה חדשה של EnhancedComponent נוצרת בכל רינדור

WrappedComponent.staticMethod = function() {/*...*/}
// Now apply a HOC
// על הקומפוננטה HOC-עכשיו נשתמש ב
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// על הקומפוננטה 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, הרפרנס מתייחס למופע הקומפוננטה המכילה החיצונית ביותר, ולא לקומפוננטה העטופה.
Copy link
Collaborator

@galnir galnir Aug 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
למרות שהמוסכמה לקומפוננטות מסדר גבוה יותר היא להעביר את כל ה- props הלאה לקומפוננטה העטופה, זה לא עובד עבור רפרנסים (refs). הסיבה לכך היא שה- `ref` הוא לא בדיוק prop - כמו `key`, React מטפלת בו באופן מיוחד. אם תוסיפו רפרנס לאלמנט שהקומפוננטה שלו נוצרה על ידי HOC, הרפרנס מתייחס למופע הקומפוננטה המכילה החיצונית ביותר, ולא לקומפוננטה העטופה.
למרות שהמוסכמה לקומפוננטות מסדר גבוה יותר היא להעביר את כל ה- props הלאה לקומפוננטה העטופה, זה לא עובד עבור רפרנסים (refs). הסיבה לכך היא שה- `ref` הוא לא בדיוק prop - כמו React, 'key' מטפלת בו באופן מיוחד. אם תוסיפו רפרנס לאלמנט שהקומפוננטה שלו נוצרה על ידי HOC, הרפרנס מתייחס למופע הקומפוננטה המכילה החיצונית ביותר, ולא לקומפוננטה העטופה.

Copy link
Author

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

Copy link
Collaborator

@galnir galnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes

@galnir galnir merged commit 1c1d0b0 into reactjs:master Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants