Skip to content
Merged
46 changes: 23 additions & 23 deletions content/warnings/dont-call-proptypes.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
---
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 = {
highlighted: PropTypes.bool
};
```

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({
body: PropTypes.object,
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 = {
Expand All @@ -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` `componentName` arqumentləri göndərilir:

```javascript
export default function deprecated(propType, explanation) {
Expand All @@ -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]) {
Expand All @@ -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.
8 changes: 4 additions & 4 deletions content/warnings/invalid-aria-prop.md
Original file line number Diff line number Diff line change
@@ -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` `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
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.
22 changes: 11 additions & 11 deletions content/warnings/legacy-factories.md
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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');
Expand All @@ -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');
Expand All @@ -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)
38 changes: 19 additions & 19 deletions content/warnings/refs-must-have-owner.md
Original file line number Diff line number Diff line change
@@ -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 `<Foo>` is a function component, you can't add a ref to it:
Əgər `<Foo>` 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!
<Foo ref={foo} />
```

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(<App ref="app" />, 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;
Expand All @@ -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.
6 changes: 3 additions & 3 deletions content/warnings/special-props.md
Original file line number Diff line number Diff line change
@@ -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` `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: `<ListItemWrapper key={result.id} id={result.id} />`). 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: `<ListItemWrapper key={result.id} id={result.id} />`) 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.
Loading