Skip to content

Commit 6fe9f94

Browse files
committed
translate proptypes warning page
1 parent 90e9866 commit 6fe9f94

File tree

1 file changed

+26
-27
lines changed

1 file changed

+26
-27
lines changed
Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,72 @@
11
---
2-
title: Don't Call PropTypes Warning
2+
title: Don't Call PropTypes Uyarısı
33
layout: single
44
permalink: warnings/dont-call-proptypes.html
55
---
66

7-
> Note:
7+
> Not:
88
>
9-
> `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).
9+
> `React.PropTypes` React v15.5 sürümünden itibaren farklı bir pakete taşındı. Lütfen onun yerine [`prop-types` kütüphanesini](https://www.npmjs.com/package/prop-types) kullanın.
1010
>
11-
>We provide [a codemod script](/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) to automate the conversion.
11+
>Dönüşümü otomatikleştirmek için [codemod scripti](/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) sunuyoruz.
1212
13-
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.
13+
React'in gelecekteki büyük sürümünde, PropType doğrulaması yapan kod bloğu ayrıştırılacak. Bu olduğu zaman, bu kodun elle çağırıldığı yerler hata verecek.
1414

15-
### Declaring PropTypes is still fine {#declaring-proptypes-is-still-fine}
15+
### PropTypes tanımlamak hala iyi {#declaring-proptypes-is-still-fine}
1616

17-
The normal usage of PropTypes is still supported:
17+
PropTypes'ın normal kullanımı hala destekleniyor:
1818

1919
```javascript
2020
Button.propTypes = {
2121
highlighted: PropTypes.bool
2222
};
2323
```
2424

25-
Nothing changes here.
25+
Burada bir şey değişmiyor.
2626

27-
### Don’t call PropTypes directly {#dont-call-proptypes-directly}
27+
### PropTypes'ı direkt olarak çağırmayın {#dont-call-proptypes-directly}
2828

29-
Using PropTypes in any other way than annotating React components with them is no longer supported:
29+
PropTypesReact komponentlerini annotate ederek kullanmanın dışındaki yollar desteklenmiyor:
3030

3131
```javascript
3232
var apiShape = PropTypes.shape({
3333
body: PropTypes.object,
3434
statusCode: PropTypes.number.isRequired
3535
}).isRequired;
3636

37-
// Not supported!
37+
// Desteklenmiyor!
3838
var error = apiShape(json, 'response');
3939
```
40+
Eğer PropTypes'ı bu şekilde kullanma zorunluluğunuz varsa, size PropTypes'ın bir kopyasını oluşturmanızı öneririz([Bu](https://github.com/aackerman/PropTypes) [iki](https://github.com/developit/proptypes) paket gibi).
4041

41-
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).
42+
Eğer uyarıyı düzeltmezseniz, bu kod React 16 sürümüyle birlikte canlı ortamda çökecektir.
4243

43-
If you don't fix the warning, this code will crash in production with React 16.
44+
### Eğer PropTypes'ı direkt çağırmadığınız halde uyarı alıyorsanız{#if-you-dont-call-proptypes-directly-but-still-get-the-warning}
4445

45-
### If you don't call PropTypes directly but still get the warning {#if-you-dont-call-proptypes-directly-but-still-get-the-warning}
46-
47-
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:
46+
Uyarıda belirtilen çalışma betiğini inceleyin. PropTypes'ı direkt olarak çağırmaya sebep olan komponenti bulacaksınız. Büyük ihtimalle uyarının sebebi React'in PropTypes özelliğini sarmallayarak kullanan bir 3. partidir, örneğin:
4847

4948
```js
5049
Button.propTypes = {
5150
highlighted: ThirdPartyPropTypes.deprecated(
5251
PropTypes.bool,
5352
'Use `active` prop instead'
5453
)
55-
}
54+
}
5655
```
5756

58-
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.
57+
Bu örnekte, `ThirdPartyPropTypes.deprecated` fonksiyonu `PropTypes.bool` sarmalayan bir fonksiyon. Bu kullanım kendi içerisinde uygun ancak React PropTypes'ı direkt çağırdınızı düşünerek yanlış pozitif olarak tetikler. Bir sonraki bölüm, `ThirdPartyPropTypes` gibi kütüphaneler kullandığınızda oluşan problemleri nasıl düzelteceğinizi açıklıyor. Eğer bu sizin yazdığınız bir kütüphane değilse, ilgili kütüphaneye sorun olarak bildirebilirsiniz.
5958

60-
### Fixing the false positive in third party PropTypes {#fixing-the-false-positive-in-third-party-proptypes}
59+
### 3. parti PropTypes'lardaki yanlış pozitifleri düzeltmek{#fixing-the-false-positive-in-third-party-proptypes}
6160

62-
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.
61+
Eğer üçüncü parti bir PropTypes kütüphanesinin geliştiricisi iseniz ve kullanıcılara React PropTypes'ı sarmalayan bir şey kullanmalarını sağlıyorsanız, onlar bu uyarının sizin kütüphanenizden geldiğini göreceklerdir. Bunun olmasının sebebi React elle yapılan PropTypes çağrısını tespit etmek için [geçtiği](https://github.com/facebook/react/pull/7132) "gizli" bir son argümanı göremiyor.
6362

64-
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:
63+
İşte nasıl çözeceğiniz. Burada örnek olarak [react-bootstrap/react-prop-types](https://github.com/react-bootstrap/react-prop-types/blob/0d1cd3a49a93e513325e3258b28a82ce7d38e690/src/deprecated.js)'dan `deprecated` fonksiyonunu kullanacağız. Mevcut implementasyonda sadece `props`, `propName`, ve `componentName` argümanları aşağıya gönderiliyor:
6564

6665
```javascript
6766
export default function deprecated(propType, explanation) {
6867
return function validate(props, propName, componentName) {
6968
if (props[propName] != null) {
70-
const message = `"${propName}" property of "${componentName}" has been deprecated.\n${explanation}`;
69+
const message = `"${componentName}"in "${propName}" özelliği kullanımdan kaldırıldı.\n${explanation}`;
7170
if (!warned[message]) {
7271
warning(false, message);
7372
warned[message] = true;
@@ -79,22 +78,22 @@ export default function deprecated(propType, explanation) {
7978
}
8079
```
8180

82-
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:
81+
Bu yanlış pozitifi düzeltmek için, **bütün** argumanları alttaki sarmallanan PropType'a geçtiğinizden emin olun. Bunu ES6 `...rest` notasyonu ile yapmak oldukça kolaydır:
8382

8483
```javascript
8584
export default function deprecated(propType, explanation) {
86-
return function validate(props, propName, componentName, ...rest) { // Note ...rest here
85+
return function validate(props, propName, componentName, ...rest) { // Not ...rest notasyonu burada
8786
if (props[propName] != null) {
88-
const message = `"${propName}" property of "${componentName}" has been deprecated.\n${explanation}`;
87+
const message = `"${componentName}"in "${propName}" özelliği kullanımdan kaldırıldı.\n${explanation}`;
8988
if (!warned[message]) {
9089
warning(false, message);
9190
warned[message] = true;
9291
}
9392
}
9493

95-
return propType(props, propName, componentName, ...rest); // and here
94+
return propType(props, propName, componentName, ...rest); // ve burada
9695
};
9796
}
9897
```
9998

100-
This will silence the warning.
99+
Bu, uyarıyı susturur.

0 commit comments

Comments
 (0)