From 965a43ff7e92f45010ae8ce19d758dbe052c2a4f Mon Sep 17 00:00:00 2001 From: Gasim Gasimzada Date: Wed, 9 Oct 2019 16:28:41 +0400 Subject: [PATCH 1/2] Translate React without JSX --- content/docs/react-without-jsx.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/content/docs/react-without-jsx.md b/content/docs/react-without-jsx.md index 85cdba45f..a22b389c6 100644 --- a/content/docs/react-without-jsx.md +++ b/content/docs/react-without-jsx.md @@ -4,45 +4,45 @@ title: React Without JSX permalink: docs/react-without-jsx.html --- -JSX is not a requirement for using React. Using React without JSX is especially convenient when you don't want to set up compilation in your build environment. +React işlətmək üçün JSX quraşdırmaq tələb olunmur. Yaranma mühitində kompilyasiya prosesi quraşdırmaq istəmədikdə React-i JSX-siz işlətmək əlverişlidir. -Each JSX element is just syntactic sugar for calling `React.createElement(component, props, ...children)`. So, anything you can do with JSX can also be done with just plain JavaScript. +JSX elementləri `React.createElement(component, props, ...children)` funksiyası üçün asan sintaksisdir. Bu səbəbdən, JSX-də mümkün olan bütün əməliyyatlar, sadə JavaScript ilə mümkündür. -For example, this code written with JSX: +Məsələn, JSX-də yazılmış kod: ```js class Hello extends React.Component { render() { - return
Hello {this.props.toWhat}
; + return
Salam {this.props.toWhat}
; } } ReactDOM.render( - , + , document.getElementById('root') ); ``` -can be compiled to this code that does not use JSX: +JSX işlətməyən bu koda kompilyasiya olunur: ```js class Hello extends React.Component { render() { - return React.createElement('div', null, `Hello ${this.props.toWhat}`); + return React.createElement('div', null, `Salam ${this.props.toWhat}`); } } ReactDOM.render( - React.createElement(Hello, {toWhat: 'World'}, null), + React.createElement(Hello, {toWhat: 'Dünya'}, null), document.getElementById('root') ); ``` -If you're curious to see more examples of how JSX is converted to JavaScript, you can try out [the online Babel compiler](babel://jsx-simple-example). +JSX-in JavaScript-ə çevrilməsi haqqında əlavə nümunələr üçün, [onlayn Babel kompilyatorundan](babel://jsx-simple-example) istifadə edə bilərsiniz. -The component can either be provided as a string, or as a subclass of `React.Component`, or a plain function for stateless components. +Təmin olunan komponentlər mətn, `React.Component` klasının subklası. və ya funksiya komponentləri üçün sadə funksiya ola bilər. -If you get tired of typing `React.createElement` so much, one common pattern is to assign a shorthand: +`React.createElement` yazısını çox yazmaqdan bezmisinizsə bu funksiyanı ilə qısa adlı dəyişənə təyin edə bilərsiniz: ```js const e = React.createElement; @@ -53,7 +53,7 @@ ReactDOM.render( ); ``` -If you use this shorthand form for `React.createElement`, it can be almost as convenient to use React without JSX. +`React.createElement` funksiyasını qısaldılmış formada istifadə etmək React-i JSX-siz işlətmək üçün əlverişli ola bilər. -Alternatively, you can refer to community projects such as [`react-hyperscript`](https://github.com/mlmorg/react-hyperscript) and [`hyperscript-helpers`](https://github.com/ohanhi/hyperscript-helpers) which offer a terser syntax. +Alternativ olaraq, terser sintaksisi təmin edən [`react-hyperscript`](https://github.com/mlmorg/react-hyperscript) və [`hyperscript-helpers`](https://github.com/ohanhi/hyperscript-helpers) kimi cəmiyyət layihələrindən istifadə edə bilərsiniz. From 06a58c2a90ac73f7600430de943b665eacc76fa2 Mon Sep 17 00:00:00 2001 From: Gasim Gasimzada Date: Thu, 10 Oct 2019 12:46:31 +0400 Subject: [PATCH 2/2] Fix React without JSX after self-review --- content/docs/react-without-jsx.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/docs/react-without-jsx.md b/content/docs/react-without-jsx.md index a22b389c6..f1933ee3b 100644 --- a/content/docs/react-without-jsx.md +++ b/content/docs/react-without-jsx.md @@ -1,12 +1,12 @@ --- id: react-without-jsx -title: React Without JSX +title: JSX-siz React permalink: docs/react-without-jsx.html --- React işlətmək üçün JSX quraşdırmaq tələb olunmur. Yaranma mühitində kompilyasiya prosesi quraşdırmaq istəmədikdə React-i JSX-siz işlətmək əlverişlidir. -JSX elementləri `React.createElement(component, props, ...children)` funksiyası üçün asan sintaksisdir. Bu səbəbdən, JSX-də mümkün olan bütün əməliyyatlar, sadə JavaScript ilə mümkündür. +JSX elementləri `React.createElement(component, props, ...children)` funksiyası üçün asan sintaksisdir. Bu səbəbdən, JSX-də mümkün olan bütün əməliyyatlar, sadə JavaScript ilə yazıla bilər. Məsələn, JSX-də yazılmış kod: @@ -38,11 +38,11 @@ ReactDOM.render( ); ``` -JSX-in JavaScript-ə çevrilməsi haqqında əlavə nümunələr üçün, [onlayn Babel kompilyatorundan](babel://jsx-simple-example) istifadə edə bilərsiniz. +JSX-in JavaScript-ə çevrilməsi haqqında əlavə nümunələr üçün [onlayn Babel kompilyatorundan](babel://jsx-simple-example) istifadə edə bilərsiniz. -Təmin olunan komponentlər mətn, `React.Component` klasının subklası. və ya funksiya komponentləri üçün sadə funksiya ola bilər. +Təmin olunan komponentin tipi, mətn, `React.Component`-in subklası və ya sadə funksiya (funksiya komponentləri üçün) ola bilər. -`React.createElement` yazısını çox yazmaqdan bezmisinizsə bu funksiyanı ilə qısa adlı dəyişənə təyin edə bilərsiniz: +`React.createElement` ifadəsini çox yazmaqdan bezmisinizsə bu funksiyanı qısa adlı dəyişənə təyin edə bilərsiniz: ```js const e = React.createElement;