From 3a76937a111d1b754d177f9200fe534b279e168f Mon Sep 17 00:00:00 2001 From: Sascha Metz Date: Fri, 10 Jan 2020 19:18:14 +0100 Subject: [PATCH 01/30] Translate until line 72 --- content/docs/jsx-in-depth.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/content/docs/jsx-in-depth.md b/content/docs/jsx-in-depth.md index eb3dc3a5b..2544a6b6b 100644 --- a/content/docs/jsx-in-depth.md +++ b/content/docs/jsx-in-depth.md @@ -1,6 +1,6 @@ --- id: jsx-in-depth -title: JSX In Depth +title: JSX im Detail permalink: docs/jsx-in-depth.html redirect_from: - "docs/jsx-spread.html" @@ -13,7 +13,7 @@ redirect_from: - "docs/jsx-in-depth-ko-KR.html" --- -Fundamentally, JSX just provides syntactic sugar for the `React.createElement(component, props, ...children)` function. The JSX code: +Im Grunde stellt JSX nur eine schönere Syntax für die `React.createElement(component, props, ...children)`-Funktion zur Verfügung. Der JSX-Code: ```js @@ -21,7 +21,7 @@ Fundamentally, JSX just provides syntactic sugar for the `React.createElement(co ``` -compiles into: +kompiliert zu: ```js React.createElement( @@ -31,13 +31,13 @@ React.createElement( ) ``` -You can also use the self-closing form of the tag if there are no children. So: +Du kannst auch die selbstschließende Version des Tags nutzen, sofern keine Kind-Elemente vorhanden sind. So kompiliert: ```js
``` -compiles into: +zu: ```js React.createElement( @@ -47,19 +47,20 @@ React.createElement( ) ``` -If you want to test out how some specific JSX is converted into JavaScript, you can try out [the online Babel compiler](babel://jsx-simple-example). +Wenn du ausprobieren möchtest wie dein JSX zu welchem JavaScript konvertiert, kannst du [den Online-Babel-Compiler](babel://jsx-simple-example) nutzen. -## Specifying The React Element Type {#specifying-the-react-element-type} +## Den React Elementen-Typ spezifizieren {#specifying-the-react-element-type} -The first part of a JSX tag determines the type of the React element. +Der erste Teil eines JSX-Tags gibt den Typen des React-Elements an. -Capitalized types indicate that the JSX tag is referring to a React component. These tags get compiled into a direct reference to the named variable, so if you use the JSX `` expression, `Foo` must be in scope. +Kapitalisierte Typen geben an dass der JSX-Tag sich auf einen React-Komponenten bezieht. Solche Tags werden in eine direkte Referenz der benannten Variablen kompiliert, folglich muss sich `Foo` auch im entsprechenden Namensraum befinden, wenn du den JSX ``-Ausdruck nutzt. -### React Must Be in Scope {#react-must-be-in-scope} -Since JSX compiles into calls to `React.createElement`, the `React` library must also always be in scope from your JSX code. +### React muss sich im Namensraum befinden {#react-must-be-in-scope} -For example, both of the imports are necessary in this code, even though `React` and `CustomButton` are not directly referenced from JavaScript: +Da JSX zu einem `React.createElement`-Aufruf kompiliert, muss auch die `React`-Bibliothek immer im Namensraum deines JSX-Codes eingebunden sein. + +Beispielsweise sind beide Importierungen in diesem Code nötig, sogar wenn weder `React` noch `CustomButton` direkt im JavaScript aufgegriffen werden: ```js{1,2,5} import React from 'react'; From dd92d012fe83c1fef3c1e8f033ceecef1a602489 Mon Sep 17 00:00:00 2001 From: Sascha Metz Date: Sun, 12 Jan 2020 19:37:24 +0100 Subject: [PATCH 02/30] Translate until line 115 --- content/docs/jsx-in-depth.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/content/docs/jsx-in-depth.md b/content/docs/jsx-in-depth.md index 2544a6b6b..6d1b16a88 100644 --- a/content/docs/jsx-in-depth.md +++ b/content/docs/jsx-in-depth.md @@ -72,11 +72,11 @@ function WarningButton() { } ``` -If you don't use a JavaScript bundler and loaded React from a `