Skip to content
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

Translated "render-props.md" #120

Closed
wants to merge 1 commit into from

Conversation

timhoffmannGIThub
Copy link

No description provided.

@netlify
Copy link

netlify bot commented Oct 29, 2019

Deploy preview for de-reactjs ready!

Built with commit c42eb32

https://deploy-preview-120--de-reactjs.netlify.com

Copy link
Member

@ph1p ph1p left a comment

Choose a reason for hiding this comment

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

Hui! This took a little bit of time. I've reviewed your translation. Please take a look at it.

@@ -42,22 +41,22 @@ class MouseTracker extends React.Component {
render() {
return (
<div style={{ height: '100%' }} onMouseMove={this.handleMouseMove}>
<h1>Move the mouse around!</h1>
<p>The current mouse position is ({this.state.x}, {this.state.y})</p>
<h1>Bewege die Maus!</h1>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<h1>Bewege die Maus!</h1>
<h1>Bewege die Maus umher!</h1>

@@ -87,19 +86,19 @@ class MouseTracker extends React.Component {
render() {
return (
<div>
<h1>Move the mouse around!</h1>
<h1>Bewege die Maus!</h1>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<h1>Bewege die Maus!</h1>
<h1>Bewege die Maus umher!</h1>

@@ -145,17 +143,18 @@ class MouseTracker extends React.Component {
render() {
return (
<div>
<h1>Move the mouse around!</h1>
<h1>Bewege die Maus!</h1>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<h1>Bewege die Maus!</h1>
<h1>Bewege die Maus umher!</h1>

@@ -199,7 +198,7 @@ class MouseTracker extends React.Component {
render() {
return (
<div>
<h1>Move the mouse around!</h1>
<h1>Bewege die Maus!</h1>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<h1>Bewege die Maus!</h1>
<h1>Bewege die Maus umher!</h1>

}

class MouseTracker extends React.Component {
render() {
return (
<div>
<h1>Move the mouse around!</h1>
<h1>Bewege die Maus!</h1>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<h1>Bewege die Maus!</h1>
<h1>Bewege die Maus umher!</h1>


{/*
This is bad! The value of the `render` prop will
be different on each render.
Nicht gut! Der Wert des `render` Prop wird
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Nicht gut! Der Wert des `render` Prop wird
Nicht gut! Der Wert des `render`-Prop wird

This is bad! The value of the `render` prop will
be different on each render.
Nicht gut! Der Wert des `render` Prop wird
bei jedem rendern verändert.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
bei jedem rendern verändert.
bei jedem Rendern verändert.

@@ -299,27 +298,27 @@ class MouseTracker extends React.Component {
}
```

In this example, each time `<MouseTracker>` renders, it generates a new function as the value of the `<Mouse render>` prop, thus negating the effect of `<Mouse>` extending `React.PureComponent` in the first place!
In diesem Beispiel wird jedes Mal, wenn `<MouseTracker>` rendert, eine neue Funktion mit dem Wert vom `<Mouse render>` Prop generiert, wodurch der Effekt von der `<Mouse>` erweiterten `React.PureComponent` negiert wird!
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
In diesem Beispiel wird jedes Mal, wenn `<MouseTracker>` rendert, eine neue Funktion mit dem Wert vom `<Mouse render>` Prop generiert, wodurch der Effekt von der `<Mouse>` erweiterten `React.PureComponent` negiert wird!
In diesem Beispiel wird jedes Mal, wenn `<MouseTracker>` rendert, eine neue Funktion mit dem Wert vom `<Mouse render>`-Prop generiert, wodurch der Effekt von der `<Mouse>` erweiterten `React.PureComponent` zunichte gemacht wird!


To get around this problem, you can sometimes define the prop as an instance method, like so:
Um dieses Problem zu umgehen, können Sie manchmal das Prop als eine Instanz-Methode definieren, in etwa so:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Um dieses Problem zu umgehen, können Sie manchmal das Prop als eine Instanz-Methode definieren, in etwa so:
Um dieses Problem zu umgehen, kannst du manchmal das Prop als eine Instanz-Methode definieren, in etwa so:

<Mouse render={this.renderTheCat} />
</div>
);
}
}
```

In cases where you cannot define the prop statically (e.g. because you need to close over the component's props and/or state) `<Mouse>` should extend `React.Component` instead.
In Fällen, in denen Sie das Prop nicht statisch definieren können (bspw., weil Sie es über den Props der Komponenten und/oder dem Zustand schließen müssen), sollte `<Mouse>` den `React.Component` stattdessen erweiten.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
In Fällen, in denen Sie das Prop nicht statisch definieren können (bspw., weil Sie es über den Props der Komponenten und/oder dem Zustand schließen müssen), sollte `<Mouse>` den `React.Component` stattdessen erweiten.
In Fällen, in denen du das Prop nicht statisch definieren kannst (bspw., weil du es über die Props der Komponenten und/oder dem State schließen musst), sollte `<Mouse>` den `React.Component` stattdessen erweitern.

Copy link
Member

@ph1p ph1p left a comment

Choose a reason for hiding this comment

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

Hui! This took a little bit of time. I've reviewed your translation. Please take a look at it.

@ph1p ph1p added needs review from author First review completed. All changes are processed and a final review is required. and removed completed - needs review 🧐 labels Nov 17, 2019
@ph1p ph1p added the idle This PR is idle and the creator has not touched it for a long time. label Dec 19, 2019
@ph1p ph1p removed idle This PR is idle and the creator has not touched it for a long time. needs review from author First review completed. All changes are processed and a final review is required. labels Feb 11, 2020
@ph1p ph1p closed this Feb 11, 2020
@ph1p
Copy link
Member

ph1p commented Feb 11, 2020

Moved to #144, because of inactivity

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.

None yet

2 participants