diff --git a/content/warnings/dont-call-proptypes.md b/content/warnings/dont-call-proptypes.md index 07dfa33f0..0aada9a73 100644 --- a/content/warnings/dont-call-proptypes.md +++ b/content/warnings/dont-call-proptypes.md @@ -1,20 +1,20 @@ --- -title: Don't Call PropTypes Warning +title: PropTypes-ı Çağırmamaq Xəbərdarlığı layout: single permalink: warnings/dont-call-proptypes.html --- -> Note: +> Qeyd: > -> `React.PropTypes` has moved into a different package since React v15.5. Please use [the `prop-types` library instead](https://www.npmjs.com/package/prop-types). +> React v15.5-dən başlayaraq `React.PropTypes` fərqli paketə köçürülüb. Əvəzinə [`prop-types` kitabxanasını](https://www.npmjs.com/package/prop-types) yükləyin. > ->We provide [a codemod script](/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) to automate the conversion. +>Köhnə PropTypes çağırışlarını yeni kitabxana çağırışlarına avtomatik çevirmək üçün [codemod skriptindən](/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) istifadə edə bilərsiniz. -In a future major release of React, the code that implements PropType validation functions will be stripped in production. Once this happens, any code that calls these functions manually (that isn't stripped in production) will throw an error. +React-in gələcək əsas versiyalarında PropTypes validasiyalarını tətbiq edən kodlar produksiyadan silinəcək. Bu baş verdikdə, PropType validasiya funksiyalarını əl ilə çağıran kodlar produksiya zamanı silinməyib xəta yaradacaq. -### Declaring PropTypes is still fine {#declaring-proptypes-is-still-fine} +### PropTypes-ı təyin ətmək hələdə mümkündür {#declaring-proptypes-is-still-fine} -The normal usage of PropTypes is still supported: +PropTypes-ın normal istifadəsi hələ də dəstəklənir: ```javascript Button.propTypes = { @@ -22,11 +22,11 @@ Button.propTypes = { }; ``` -Nothing changes here. +Burada heç nə dəyişmir. -### Don’t call PropTypes directly {#dont-call-proptypes-directly} +### PropTypes-ı birbaşa çağırmayın {#dont-call-proptypes-directly} -Using PropTypes in any other way than annotating React components with them is no longer supported: +React komponentlərinin annotasiya edilməsindən əlavə işlər üçün PropTypes-ın işlədilməsi artıq dəstəklənmir: ```javascript var apiShape = PropTypes.shape({ @@ -34,17 +34,17 @@ var apiShape = PropTypes.shape({ statusCode: PropTypes.number.isRequired }).isRequired; -// Not supported! +// Dəstəklənmir! var error = apiShape(json, 'response'); ``` -If you depend on using PropTypes like this, we encourage you to use or create a fork of PropTypes (such as [these](https://github.com/aackerman/PropTypes) [two](https://github.com/developit/proptypes) packages). +Əgər sizə PropTypes-ı bu formada işlətmək lazımdırsa PropTypes-ın forkunu yaratmağı ([bu](https://github.com/aackerman/PropTypes) [iki](https://github.com/developit/proptypes) paket kimi) tövsiyyə edirik. -If you don't fix the warning, this code will crash in production with React 16. +Bu xəbərdarlığı düzəltmədikdə React 16-da yazılmış applikasiya produksiyada sınacaq. -### If you don't call PropTypes directly but still get the warning {#if-you-dont-call-proptypes-directly-but-still-get-the-warning} +### PropTypes-ı birbaşa çağırmadıqda bu xəbərdarlığı görürsünüzsə {#if-you-dont-call-proptypes-directly-but-still-get-the-warning} -Inspect the stack trace produced by the warning. You will find the component definition responsible for the PropTypes direct call. Most likely, the issue is due to third-party PropTypes that wrap React’s PropTypes, for example: +Xəbərdarlıqdan yaranan stək izini yoxlayın. Siz bu formada PropTypes-ı birbaşa çağıran komponenti tapacaqsınız. Adətən, bu xəbədarlıq React-in PropTypes kitabxanasını əhatə edən 3-cü tərəfin yaratdığı PropTypes kitabxanasından yarana bilər. Məsələn: ```js Button.propTypes = { @@ -55,13 +55,13 @@ Button.propTypes = { } ``` -In this case, `ThirdPartyPropTypes.deprecated` is a wrapper calling `PropTypes.bool`. This pattern by itself is fine, but triggers a false positive because React thinks you are calling PropTypes directly. The next section explains how to fix this problem for a library implementing something like `ThirdPartyPropTypes`. If it's not a library you wrote, you can file an issue against it. +Bu ssenaridə `ThirdPartyPropTypes.deprecated` funksiyası `PropTypes.bool` funksiyasını çağırır. Bu pattern özlüyündə normaldır. Lakin bu pattern səhv müsbətin yaranması ilə nəticələnə bilər. Çünki React, PropTypes-ı birbaşa çağırdığınızı fikirləşir. Sonrakı bölmədə, `ThirdPartyPropTypes` kimi kitabxananın bu problemi necə düzəldəcəyini başa salacağıq. Əgər bu kitabxana sizə məxsus deyilsə kitabxana yaradıcısını bu problemi düzəltməsi üçün məlumatlandırın. -### Fixing the false positive in third party PropTypes {#fixing-the-false-positive-in-third-party-proptypes} +### 3-cü tərəfin PropTypes kitabxanasında səhv müsbətin düzəlişi {#fixing-the-false-positive-in-third-party-proptypes} -If you are an author of a third party PropTypes library and you let consumers wrap existing React PropTypes, they might start seeing this warning coming from your library. This happens because React doesn't see a "secret" last argument that [it passes](https://github.com/facebook/react/pull/7132) to detect manual PropTypes calls. +Əgər 3-cü tərəfin PropTypes kitabxanasının yaradıcısınızsa və istifadəçilərə mövcud React PropTypes-ı əhatə etməyə imkan yaradırsınızsa, istifadəçilər sizin kitabxananızı işlətdikdə bu xəbərdarlığı görə bilərlər. Bu xəbərdarlıq React-in əl ilə çağrılan PropTypes çağırışlarını aşkar etmək üçün [göndərdiyi](https://github.com/facebook/react/pull/7132) sonuncu "gizli" arqumenti görməməsindən baş verir. -Here is how to fix it. We will use `deprecated` from [react-bootstrap/react-prop-types](https://github.com/react-bootstrap/react-prop-types/blob/0d1cd3a49a93e513325e3258b28a82ce7d38e690/src/deprecated.js) as an example. The current implementation only passes down the `props`, `propName`, and `componentName` arguments: +Bu problemi aşağıdakı formada düzəldə bilərsiniz. Biz [react-bootstrap/react-prop-types](https://github.com/react-bootstrap/react-prop-types/blob/0d1cd3a49a93e513325e3258b28a82ce7d38e690/src/deprecated.js) paketindən `deprecated` funksiyasını misal kimi gətirəcəyik. Cari tətbiqdə yalnız `props`, `propName` və `componentName` arqumentləri göndərilir: ```javascript export default function deprecated(propType, explanation) { @@ -79,11 +79,11 @@ export default function deprecated(propType, explanation) { } ``` -In order to fix the false positive, make sure you pass **all** arguments down to the wrapped PropType. This is easy to do with the ES6 `...rest` notation: +Səhv müsbəti düzəltmək üçün PropTypes-a **bütün** arqumentləri göndərdiyinizdən əmin olun. Bunu ES6-ın `...rest` sintaksisi ilə asan formada tətbiq etmək mümkündür: ```javascript export default function deprecated(propType, explanation) { - return function validate(props, propName, componentName, ...rest) { // Note ...rest here + return function validate(props, propName, componentName, ...rest) { // ...rest-ə fikir verin if (props[propName] != null) { const message = `"${propName}" property of "${componentName}" has been deprecated.\n${explanation}`; if (!warned[message]) { @@ -92,9 +92,9 @@ export default function deprecated(propType, explanation) { } } - return propType(props, propName, componentName, ...rest); // and here + return propType(props, propName, componentName, ...rest); // və burada }; } ``` -This will silence the warning. +Bu arqumentlərin əlavəsi xəbərdarlığı susduracaq. diff --git a/content/warnings/invalid-aria-prop.md b/content/warnings/invalid-aria-prop.md index 53ebdd9bc..70f0ee72f 100644 --- a/content/warnings/invalid-aria-prop.md +++ b/content/warnings/invalid-aria-prop.md @@ -1,11 +1,11 @@ --- -title: Invalid ARIA Prop Warning +title: Etibarsız ARIA Propu Xəbərdarlığı layout: single permalink: warnings/invalid-aria-prop.html --- -The invalid-aria-prop warning will fire if you attempt to render a DOM element with an aria-* prop that does not exist in the Web Accessibility Initiative (WAI) Accessible Rich Internet Application (ARIA) [specification](https://www.w3.org/TR/wai-aria-1.1/#states_and_properties). +DOM elementini Web Accessibility Initiative (WAI) Accessible Rich Internet Application (ARIA) [spesifikasiyasında](https://www.w3.org/TR/wai-aria-1.1/#states_and_properties) olmayan aria-* propu ilə render etdikdə invalid-aria-prop xəbərdarlığı göstəriləcək. -1. If you feel that you are using a valid prop, check the spelling carefully. `aria-labelledby` and `aria-activedescendant` are often misspelled. +1. Əgər etibarlı prop işlətdiyinizi fikirləşirsinizsə sözün hərflərlə tələffüzünə diqqət yetirin. Adətən, `aria-labelledby` və `aria-activedescendant` propları səhv tələffüz olunurlar. -2. React does not yet recognize the attribute you specified. This will likely be fixed in a future version of React. However, React currently strips all unknown attributes, so specifying them in your React app will not cause them to be rendered \ No newline at end of file +2. Təyin edilən atributu React tanımır. Çox guman ki, bu atribut React-in gələcək versiyalarında əlavə ediləcək. Lakin, hal-hazırda React-in tanımadığı bütün atributlar silinir və render edilmir. \ No newline at end of file diff --git a/content/warnings/legacy-factories.md b/content/warnings/legacy-factories.md index a99d22e2f..e179a2b39 100644 --- a/content/warnings/legacy-factories.md +++ b/content/warnings/legacy-factories.md @@ -1,22 +1,22 @@ --- -title: React Element Factories and JSX Warning +title: React Element Zavodları və JSX Xəbərdarlığı layout: single permalink: warnings/legacy-factories.html --- -You probably came here because your code is calling your component as a plain function call. This is now deprecated: +Komponenti sadə funksiya çağırışı ilə çağırdıqda bu xəbərdarlıq göstərilir. Bu formada komponentləri çağırmaq köhnəlib: ```javascript var MyComponent = require('MyComponent'); function render() { - return MyComponent({ foo: 'bar' }); // WARNING + return MyComponent({ foo: 'bar' }); // XƏBƏRDARLIQ } ``` ## JSX {#jsx} -React components can no longer be called directly like this. Instead [you can use JSX](/docs/jsx-in-depth.html). +React komponentlərinin bu formada birbaşa çağrılması dəstəklənmir. Əvəzinə [JSX istifadə edin](/docs/jsx-in-depth.html). ```javascript var React = require('react'); @@ -27,9 +27,9 @@ function render() { } ``` -## Without JSX {#without-jsx} +## JSX-siz İstifadə {#without-jsx} -If you don't want to, or can't use JSX, then you'll need to wrap your component in a factory before calling it: +Əgər JSX istifadə etmək istəmirsinizsə və ya istifadə edə bilmirsinizsə komponenti çağırmamışdan öncə zavod ilə əhatə etməlisiniz: ```javascript var React = require('react'); @@ -40,11 +40,11 @@ function render() { } ``` -This is an easy upgrade path if you have a lot of existing function calls. +Bu, çoxlu funksiya olduqda kodu yeniləmənin asan yoludur. -## Dynamic components without JSX {#dynamic-components-without-jsx} +## JSX-siz Dinamik Komponentlər {#dynamic-components-without-jsx} -If you get a component class from a dynamic source, then it might be unnecessary to create a factory that you immediately invoke. Instead you can just create your element inline: +Komponent klası dinamik mənbədən alındıqda dərhal çağrılacaq komponent üçün zavod yaratmaq lazımsız ola bilər. Əvəzinə, elementi birbaşa yaradın: ```javascript var React = require('react'); @@ -54,6 +54,6 @@ function render(MyComponent) { } ``` -## In Depth {#in-depth} +## Dərindən {#in-depth} -[Read more about WHY we're making this change.](https://gist.github.com/sebmarkbage/d7bce729f38730399d28) +[Bu dəyişikliyin səbəbi haqqında məlumat üçün bu yazını oxuyun.](https://gist.github.com/sebmarkbage/d7bce729f38730399d28) diff --git a/content/warnings/refs-must-have-owner.md b/content/warnings/refs-must-have-owner.md index 9eda89c4c..4ccbd746c 100644 --- a/content/warnings/refs-must-have-owner.md +++ b/content/warnings/refs-must-have-owner.md @@ -1,48 +1,48 @@ --- -title: Refs Must Have Owner Warning +title: Ref-lərin Sahibləri Olması Xəbərdarlığı layout: single permalink: warnings/refs-must-have-owner.html --- -You are probably here because you got one of the following error messages: +Siz aşağıdakı xəta mesajlarına görə buradasınız: *React 16.0.0+* > Warning: > > Element ref was specified as a string (myRefName) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner). -*earlier versions of React* +*React-in əvvəlki versiyalarında* > Warning: > > addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded. -This usually means one of three things: +Bu xəbərdarlıq adətən üç səbəbdən yarana bilər: -- You are trying to add a `ref` to a function component. -- You are trying to add a `ref` to an element that is being created outside of a component's render() function. -- You have multiple (conflicting) copies of React loaded (eg. due to a misconfigured npm dependency) +- `ref`-i funksiya komponentinə qoşduqda. +- Komponentin render() funksiyasından kənarda yaranan elementə mətn `ref`-i qoşduqda. +- Layihədə React-in konfliktdə olan bir neçə versiyası yükləndikdə (məsələn, səhv qurulmuş NPM paketinə görə). -## Refs on Function Components {#refs-on-function-components} +## Funksiya Komponentlərinə Ref-lər {#refs-on-function-components} -If `` is a function component, you can't add a ref to it: +Əgər `` funksiya komponentidirsə bu komponentə ref əlavə etmək olmaz: ```js -// Doesn't work if Foo is a function! +// Əgər Foo funksiyadırsa, işləməyəcək! ``` -If you need to add a ref to a component, convert it to a class first, or consider not using refs as they are [rarely necessary](/docs/refs-and-the-dom.html#when-to-use-refs). +Əgər komponentə ref əlavə etmək lazımdırsa bu komponenti ilk olaraq klasa çevirin. Və ya komponentlər üçün ümümiyyətlə ref işlətməyin. Çünki bu [nadir hallarda lazımdır](/docs/refs-and-the-dom.html#when-to-use-refs). -## Strings Refs Outside the Render Method {#strings-refs-outside-the-render-method} +## Render Funksiyasından Kənarda Mətn Ref-ləri {#strings-refs-outside-the-render-method} -This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component's `render` method). For example, this won't work: +Adətən sahibi olmayan komponentə (yəni digər komponentin `render` funksiyasından əlavə edilməyən) `ref` əlavə etdikdə xəbədarlıq göstəriləcək. Məsələn, aşağıdakı kod işləməyəcək: ```js -// Doesn't work! +// İşləmir! ReactDOM.render(, el); ``` -Try rendering this component inside of a new top-level component which will hold the ref. Alternatively, you may use a callback ref: +Bu komponenti ref-i saxlayan valideyn komponentdən render edin. Alternativ olaraq callback ref-indən istifadə edə bilərsiniz: ```js let app; @@ -54,10 +54,10 @@ ReactDOM.render( ); ``` -Consider if you [really need a ref](/docs/refs-and-the-dom.html#when-to-use-refs) before using this approach. +Bu yolu işlətməmişdən öncə [ref-lərə ehtiyacı olduğunuzdan](/docs/refs-and-the-dom.html#when-to-use-refs) əmin olun. -## Multiple copies of React {#multiple-copies-of-react} +## React-in Bir Neçə Kopiyası {#multiple-copies-of-react} -Bower does a good job of deduplicating dependencies, but npm does not. If you aren't doing anything (fancy) with refs, there is a good chance that the problem is not with your refs, but rather an issue with having multiple copies of React loaded into your project. Sometimes, when you pull in a third-party module via npm, you will get a duplicate copy of the dependency library, and this can create problems. +Bower asılılıqların duplikasiyalarını silə bilir. NPM isə bunu etmir. Əgər siz ref-lər ilə işləmirsinizsə problem ref-lərdə olmaya bilər. Layihədə React-in bir neçə kopiyasının yükləməsindən problem yarana bilər. Bəzən, 3-cü tərəfin modulunu NPM ilə yüklədikdə, bu modul React-in fərqli kopiyasını yükləyə bilər. Bu səbəbdən problemlər yarana bilər. -If you are using npm... `npm ls` or `npm ls react` might help illuminate. +Əgər NPM işlədirsinizsə `npm ls` və ya `npm ls react` əmrləri ilə nə baş verdiyi haqqda məlumat ala bilərsiniz. diff --git a/content/warnings/special-props.md b/content/warnings/special-props.md index 32857abf2..63b42296d 100644 --- a/content/warnings/special-props.md +++ b/content/warnings/special-props.md @@ -1,9 +1,9 @@ --- -title: Special Props Warning +title: Xüsusi Proplar Xəbərdarlığı layout: single permalink: warnings/special-props.html --- -Most props on a JSX element are passed on to the component, however, there are two special props (`ref` and `key`) which are used by React, and are thus not forwarded to the component. +JSX elementində olan propların əksəriyyəti komponentə göndərilir. Lakin, React tərəfindən işlədilən iki xüsusi prop (`ref` və `key`) komponentə yönləndirilmir. -For instance, attempting to access `this.props.key` from a component (i.e., the render function or [propTypes](/docs/typechecking-with-proptypes.html#proptypes)) is not defined. If you need to access the same value within the child component, you should pass it as a different prop (ex: ``). While this may seem redundant, it's important to separate app logic from reconciling hints. +Məsələn, komponentdən `this.props.key`-i oxumaq (i.e., render funksiyası və ya [propTypes-dan](/docs/typechecking-with-proptypes.html#proptypes)) təyin edilməyib. Əgər sizə eyni dəyəri uşaq komponentdən oxumaq lazımdırsa bu dəyəri komponentə əlavə prop ilə (məsələn: ``) göndərin. Bu, lazımsız görünə bilər. Lakin, applikasiya məntiqini rekonsilyasiya işarələrindən ayırmaq vacibdir. diff --git a/content/warnings/unknown-prop.md b/content/warnings/unknown-prop.md index 783d1b385..60b78a0a3 100644 --- a/content/warnings/unknown-prop.md +++ b/content/warnings/unknown-prop.md @@ -1,39 +1,39 @@ --- -title: Unknown Prop Warning +title: Tanınmayan Prop Xəbərdarlığı layout: single permalink: warnings/unknown-prop.html --- -The unknown-prop warning will fire if you attempt to render a DOM element with a prop that is not recognized by React as a legal DOM attribute/property. You should ensure that your DOM elements do not have spurious props floating around. +DOM elementini React-in leqal DOM atribut/parametri kimi tanımadığı prop ilə render etdikdə unknown-prop xəbərdarlığı göstəriləcək. DOM elementlərində saxta propların olmadığından əmin olun. -There are a couple of likely reasons this warning could be appearing: +Bu xəbərdarlığın göstərilməsinin bir neçə səbəbi ola bilər: -1. Are you using `{...this.props}` or `cloneElement(element, this.props)`? Your component is transferring its own props directly to a child element (eg. [transferring props](/docs/transferring-props.html)). When transferring props to a child component, you should ensure that you are not accidentally forwarding props that were intended to be interpreted by the parent component. +1. `{...this.props}` və ya `cloneElement(element, this.props)` işlədirsiniz? Komponent öz proplarını birbaşa uşaq elementinə göndərdikdə (məsələn, [propların köçürülməsi](/docs/transferring-props.html)) xəbərdarlıq baş verə bilər. Propları uşaq komponentə köçürdükdə, ana komponent tərəfindən şərh edilməli propları yönləndirmədiyinizdən əmin olun. -2. You are using a non-standard DOM attribute on a native DOM node, perhaps to represent custom data. If you are trying to attach custom data to a standard DOM element, consider using a custom data attribute as described [on MDN](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes). +2. DOM-da standart olmayan DOM atributundan istifadə etidkə (məsələn, xüsusi məlumatı təmsil etmək üçün) xəbərdarlıq baş verə bilər. Əgər standart DOM elementinə xüsusi atribut qoşmaq istəyirsinizsə, [MDN-də](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes) göstərildiyi kimi xüsusi data atributlarından istifadə edin. -3. React does not yet recognize the attribute you specified. This will likely be fixed in a future version of React. However, React currently strips all unknown attributes, so specifying them in your React app will not cause them to be rendered. +3. Təyin edilən atributu React tanımır. Çox guman ki, bu atribut React-in gələcək versiyalarında əlavə ediləcək. Lakin, hal-hazırda React-in tanımadığı bütün atributlar silinir və render edilmir. -4. You are using a React component without an upper case. React interprets it as a DOM tag because [React JSX transform uses the upper vs. lower case convention to distinguish between user-defined components and DOM tags](/docs/jsx-in-depth.html#user-defined-components-must-be-capitalized). +4. React komponentini böyük hərflə yazılmadıqda xəbərdarlıq baş verə bilər. React, kiçik hərf ilə yazılan komponentləri DOM təqləri kimi qəbul edir. Çünki, [React-in JSX çeviricisi böyük və kiçik hərf konvensiyasından istifadə edərək istifadəçi tərəfindən təyin edilən komponentləri və DOM təqlərini fəqrləndirir](/docs/jsx-in-depth.html#user-defined-components-must-be-capitalized). --- -To fix this, composite components should "consume" any prop that is intended for the composite component and not intended for the child component. Example: +Bunu düzəltmək üçün kompozit komponentə aid olan bütün proplar kompozit tərəfindən udulub və uşaq komponentlərə göndərilməməlidir. Məsələn: -**Bad:** Unexpected `layout` prop is forwarded to the `div` tag. +**Pis:** Gözlənilməz `layout` propu `div` təqinə göndərilir. ```js function MyDiv(props) { if (props.layout === 'horizontal') { - // BAD! Because you know for sure "layout" is not a prop that
understands. + // Pis! Çünki siz "layout"
-in başa düşmədiyi propdur. return
} else { - // BAD! Because you know for sure "layout" is not a prop that
understands. + // Pis! Çünki siz "layout"
-in başa düşmədiyi propdur. return
} } ``` -**Good:** The spread operator can be used to pull variables off props, and put the remaining props into a variable. +**Yaxşı:** Yayma operatoru ilə lazımlı dəyişəni proplardan ayırıb qalan propları digər dəyişəndə saxlamaq mümkündür. ```js function MyDiv(props) { @@ -46,7 +46,7 @@ function MyDiv(props) { } ``` -**Good:** You can also assign the props to a new object and delete the keys that you're using from the new object. Be sure not to delete the props from the original `this.props` object, since that object should be considered immutable. +**Yaxşı:** Siz həmçinin propları yeni obyektə təyin edib, yeni obyektdən lazımsız açarları silə bilərsiniz. Əmin olun ki, orijinal `this.props` obyektindən açarları silmirsiniz. Bu obyekt dəyişməzdir. ```js function MyDiv(props) {