From f5015c18734dbb752bb5dc47baa09f390012fdc2 Mon Sep 17 00:00:00 2001 From: Gasim Gasimzada Date: Wed, 9 Oct 2019 15:54:59 +0400 Subject: [PATCH 1/2] Translate JSX in Depth --- content/docs/jsx-in-depth.md | 214 +++++++++++++++++------------------ content/docs/nav.yml | 2 +- 2 files changed, 108 insertions(+), 108 deletions(-) diff --git a/content/docs/jsx-in-depth.md b/content/docs/jsx-in-depth.md index eb3dc3a5b..598761230 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: Dərindən JSX permalink: docs/jsx-in-depth.html redirect_from: - "docs/jsx-spread.html" @@ -13,31 +13,31 @@ 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: +Fundamental olaraq JSX, `React.createElement(component, props, ...children)` funksiyası üçün asan başa düşülə bilən sintaksisdir. Göstərilən JSX kodu: ```js - Click Me + Tıkla ``` -compiles into: +aşağıdakı koda kompilyasiya olunur: ```js React.createElement( MyButton, {color: 'blue', shadowSize: 2}, - 'Click Me' + 'Tıkla' ) ``` -You can also use the self-closing form of the tag if there are no children. So: +Əgər uşaqlar yoxdursa, siz təqin özü bağlanan formasından istifadə edə bilərsiniz. Göstərilən kod: ```js
``` -compiles into: +aşağıdakı koda kompilyasiya olunur: ```js React.createElement( @@ -47,19 +47,19 @@ 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). +Hər hansı bir JSX-in JavaScript-ə necə çevrildiyini yoxlamaq üçün [onlayn Babel kompilyatorundan istifadə edə bilərsiniz](babel://jsx-simple-example). -## Specifying The React Element Type {#specifying-the-react-element-type} +## React Element Tipinin Müəyyənləşdirilməsi {#specifying-the-react-element-type} -The first part of a JSX tag determines the type of the React element. +JSX təqinin ilk hissəsi React elementinin tipini təyin edir. -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. +Böyük hərf ilə yazılan tiplər JSX təqinin React komponentinə istinad etdiyini göstərir. Bu təqlər dəyişənin adından istifadə edərək kompilyasiya olunur. Bu səbəbdən, `` JSX ifadəsindən istifadə etdikdə `Foo` dəyişəmi göstərilən scope-da olmalıdır. -### React Must Be in Scope {#react-must-be-in-scope} +### React Scope-da Olmalıdır {#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. +JSX kodu `React.createElement` çağırışlarına kompilyasiya olduğundan `React` hər zaman JSX-in Scope-unda olmalıdır. -For example, both of the imports are necessary in this code, even though `React` and `CustomButton` are not directly referenced from JavaScript: +JavaScript-in `React` və `CustomButton` dəyişənlərinə birbaşa istinad etməməsinə baxmayaraq, aşağıdakı kodda hər iki idxalın olması vacibdir: ```js{1,2,5} import React from 'react'; @@ -71,18 +71,18 @@ function WarningButton() { } ``` -If you don't use a JavaScript bundler and loaded React from a `