{"id":30639,"date":"2025-09-30T04:41:09","date_gmt":"2025-09-30T01:41:09","guid":{"rendered":"https:\/\/fatihsoysal.com\/blog\/?p=30639"},"modified":"2025-09-30T04:41:09","modified_gmt":"2025-09-30T01:41:09","slug":"react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber","status":"publish","type":"post","link":"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/","title":{"rendered":"React.PropTypes Kullanarak Tiplerle \u00c7al\u0131\u015fmak: Kapsaml\u0131 Bir Rehber"},"content":{"rendered":"<p><body><\/p>\n<h2>React.PropTypes Kullanarak Tiplerle \u00c7al\u0131\u015fmak: Kapsaml\u0131 Bir Rehber<\/h2>\n<p>React, kullan\u0131c\u0131 aray\u00fczleri olu\u015fturmak i\u00e7in pop\u00fcler bir JavaScript k\u00fct\u00fcphanesidir. Bile\u015fen tabanl\u0131 mimarisi sayesinde karma\u015f\u0131k UI&#8217;lar\u0131 y\u00f6netilebilir par\u00e7alara ay\u0131rmay\u0131 m\u00fcmk\u00fcn k\u0131lar. Bu bile\u015fenler, d\u0131\u015far\u0131dan gelen verilerle (props) beslenerek dinamik ve etkile\u015fimli i\u00e7erikler sunar. Ancak, bir bile\u015fenin do\u011fru \u00e7al\u0131\u015fabilmesi i\u00e7in bekledi\u011fi prop&#8217;lar\u0131n do\u011fru t\u00fcrde ve formatta olmas\u0131 kritik \u00f6neme sahiptir. \u0130\u015fte tam bu noktada <code>React.PropTypes<\/code> devreye girer. Bu makale, <code>React.PropTypes<\/code>&#8216;\u0131n ne oldu\u011funu, neden kullan\u0131lmas\u0131 gerekti\u011fini, nas\u0131l kullan\u0131laca\u011f\u0131n\u0131 ve modern JavaScript ekosistemindeki yerini kapsaml\u0131 bir \u015fekilde inceleyecektir.<\/p>\n<h3>Giri\u015f: Neden Tip Kontrol\u00fc \u00d6nemli?<\/h3>\n<p>Yaz\u0131l\u0131m geli\u015ftirme s\u00fcrecinde hatalar\u0131 erken yakalamak, hem zaman hem de maliyet a\u00e7\u0131s\u0131ndan b\u00fcy\u00fck avantajlar sa\u011flar. \u00d6zellikle b\u00fcy\u00fck ve karma\u015f\u0131k uygulamalarda, bir bile\u015fene yanl\u0131\u015f t\u00fcrde veya eksik bir prop ge\u00e7ilmesi, beklenmedik davran\u0131\u015flara, hata mesajlar\u0131na veya uygulaman\u0131n \u00e7\u00f6kmesine neden olabilir. JavaScript&#8217;in dinamik yap\u0131s\u0131, bu t\u00fcr hatalar\u0131n \u00e7al\u0131\u015fma zaman\u0131na kadar fark edilmemesine yol a\u00e7abilir. Bu durum, &#8220;tip g\u00fcvenli\u011fi&#8221; (type safety) kavram\u0131n\u0131 \u00f6n plana \u00e7\u0131kar\u0131r.<\/p>\n<p>React geli\u015ftiricileri i\u00e7in tip g\u00fcvenli\u011fini sa\u011flaman\u0131n yollar\u0131ndan biri <code>PropTypes<\/code>&#8216;\u0131 kullanmakt\u0131r. <code>PropTypes<\/code>, bir React bile\u015fenine iletilen prop&#8217;lar\u0131n t\u00fcrlerini ve gereksinimlerini tan\u0131mlaman\u0131za olanak tan\u0131yan bir mekanizmad\u0131r. Bu sayede, geli\u015ftirme a\u015famas\u0131nda potansiyel hatalar hakk\u0131nda uyar\u0131lar alabilir, kodunuzun daha sa\u011flam ve \u00f6ng\u00f6r\u00fclebilir olmas\u0131n\u0131 sa\u011flayabilirsiniz. Modern React geli\u015ftirme d\u00fcnyas\u0131nda TypeScript ve Flow gibi statik tip denetleyicileri pop\u00fclerlik kazanm\u0131\u015f olsa da, <code>PropTypes<\/code> h\u00e2l\u00e2 bir\u00e7ok projede kullan\u0131lmakta veya en az\u0131ndan React&#8217;\u0131n temel felsefesini anlamak i\u00e7in \u00f6nemli bir ara\u00e7 olarak varl\u0131\u011f\u0131n\u0131 s\u00fcrd\u00fcrmektedir. \u00d6zellikle mevcut projelerde veya basit bile\u015fenler i\u00e7in h\u0131zl\u0131 ve etkili bir \u00e7\u00f6z\u00fcm sunar.<\/p>\n<h3>Temel Kavramlar ve Kurulum<\/h3>\n<p><code>PropTypes<\/code>&#8216;\u0131n ne oldu\u011funu ve neden kullan\u0131ld\u0131\u011f\u0131n\u0131 anlamak, React bile\u015fenlerinizi daha g\u00fcvenli ve bak\u0131m\u0131 kolay hale getirmenin ilk ad\u0131m\u0131d\u0131r.<\/p>\n<h4>PropTypes Nedir?<\/h4>\n<p><code>PropTypes<\/code>, React bile\u015fenlerinin bekledi\u011fi prop&#8217;lar\u0131n veri t\u00fcrlerini (string, number, boolean, object, array vb.) ve gerekliliklerini (zorunlu olup olmad\u0131\u011f\u0131n\u0131) belirtmek i\u00e7in kullan\u0131lan bir do\u011frulama mekanizmas\u0131d\u0131r. Bir bile\u015fene tan\u0131mlanan <code>propTypes<\/code> nesnesi, o bile\u015fenin &#8220;s\u00f6zle\u015fmesini&#8221; olu\u015fturur; yani, di\u011fer geli\u015ftiricilere veya bile\u015fenin kendi kendisine hangi verileri bekledi\u011fini a\u00e7\u0131k\u00e7a bildirir. E\u011fer bir bile\u015fene tan\u0131mlanan <code>propTypes<\/code>&#8216;a uymayan bir prop iletilirse, React geli\u015ftirme konsolunda bir uyar\u0131 mesaj\u0131 g\u00f6sterir.<\/p>\n<h4>Neden PropType Kullanmal\u0131y\u0131z?<\/h4>\n<p>1.  <strong>Hata Yakalama ve \u00d6nleme:<\/strong> Geli\u015ftirme a\u015famas\u0131nda prop hatalar\u0131n\u0131 erken tespit ederek \u00e7al\u0131\u015fma zaman\u0131 hatalar\u0131n\u0131 azalt\u0131r. Yanl\u0131\u015f t\u00fcrde veri iletilmesi durumunda konsolda net uyar\u0131lar al\u0131rs\u0131n\u0131z.<br \/>\n2.  <strong>Dok\u00fcmantasyon:<\/strong> <code>propTypes<\/code> tan\u0131mlar\u0131, bile\u015fenin bekledi\u011fi veriler hakk\u0131nda a\u00e7\u0131k ve okunabilir bir dok\u00fcmantasyon g\u00f6revi g\u00f6r\u00fcr. Di\u011fer geli\u015ftiricilerin bile\u015feni do\u011fru \u015fekilde kullanmas\u0131na yard\u0131mc\u0131 olur.<br \/>\n3.  <strong>Kod Kalitesi ve Bak\u0131m Kolayl\u0131\u011f\u0131:<\/strong> Daha g\u00fcvenilir ve anla\u015f\u0131l\u0131r kod yaz\u0131lmas\u0131n\u0131 te\u015fvik eder. Bile\u015fenlerinizi gelecekte de\u011fi\u015ftirmek veya ba\u015fkalar\u0131n\u0131n kullanmas\u0131n\u0131 sa\u011flamak daha kolay hale gelir.<br \/>\n4.  <strong>Ekip \u00c7al\u0131\u015fmas\u0131:<\/strong> Bir ekip i\u00e7inde \u00e7al\u0131\u015f\u0131rken, <code>propTypes<\/code> bir &#8220;API s\u00f6zle\u015fmesi&#8221; g\u00f6revi g\u00f6rerek geli\u015ftiricilerin birbirlerinin bile\u015fenlerini do\u011fru bir \u015fekilde entegre etmelerini sa\u011flar.<\/p>\n<h4>Kurulum ve Kullan\u0131m<\/h4>\n<p>React&#8217;\u0131n eski s\u00fcr\u00fcmlerinde (<code>React v15.5'ten \u00f6nce<\/code>), <code>PropTypes<\/code> do\u011frudan <code>React<\/code> nesnesinin bir par\u00e7as\u0131yd\u0131 (<code>React.PropTypes<\/code>). Ancak, bu \u00f6zellik daha sonra ayr\u0131 bir pakete ta\u015f\u0131nm\u0131\u015ft\u0131r. Bunun temel nedeni, \u00fcretim (production) ortam\u0131nda <code>PropTypes<\/code> kontrol\u00fcn\u00fcn performans maliyetini ortadan kald\u0131rmak ve React&#8217;\u0131n \u00e7ekirdek paketini daha hafif tutmakt\u0131r.<\/p>\n<p>G\u00fcn\u00fcm\u00fczde <code>PropTypes<\/code> kullanmak i\u00e7in \u00f6ncelikle <code>prop-types<\/code> paketini projenize eklemeniz gerekir:<\/p>\n<pre><code class=\"language-bash\">npm install prop-types\n<h2>veya<\/h2>\nyarn add prop-types<\/code><\/pre>\n<p>Daha sonra, kullanaca\u011f\u0131n\u0131z her dosyada <code>prop-types<\/code> paketini import etmelisiniz:<\/p>\n<pre><code class=\"language-javascript\">import PropTypes from 'prop-types';<\/code><\/pre>\n<p>Bir bile\u015fende <code>propTypes<\/code> tan\u0131mlamak i\u00e7in, bile\u015fen s\u0131n\u0131f\u0131n\u0131n veya fonksiyonunun hemen alt\u0131na <code>propTypes<\/code> ad\u0131nda statik bir \u00f6zellik eklenir:<\/p>\n<pre><code class=\"language-javascript\">\/\/ S\u0131n\u0131f Bile\u015feni\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nclass MyComponent extends React.Component {\n  render() {\n    return (\n      <div>\n        <p>Ad: {this.props.name}<\/p>\n        <p>Ya\u015f: {this.props.age}<\/p>\n      <\/div>\n    );\n  }\n}\n\nMyComponent.propTypes = {\n  name: PropTypes.string,\n  age: PropTypes.number,\n};\n\nexport default MyComponent;<\/code><\/pre>\n<pre><code class=\"language-javascript\">\/\/ Fonksiyonel Bile\u015fen\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nconst MyFunctionalComponent = (props) => {\n  return (\n    <div>\n      <p>Mesaj: {props.message}<\/p>\n      <p>Aktif mi: {props.isActive ? 'Evet' : 'Hay\u0131r'}<\/p>\n    <\/div>\n  );\n};\n\nMyFunctionalComponent.propTypes = {\n  message: PropTypes.string,\n  isActive: PropTypes.bool,\n};\n\nexport default MyFunctionalComponent;<\/code><\/pre>\n<p>Bu \u00f6rneklerde, <code>MyComponent<\/code>&#8216;\u0131n <code>name<\/code> ad\u0131nda bir string prop ve <code>age<\/code> ad\u0131nda bir number prop bekledi\u011fi belirtilmi\u015ftir. E\u011fer <code>name<\/code> prop&#8217;u bir say\u0131 olarak veya <code>age<\/code> prop&#8217;u bir string olarak ge\u00e7ilirse, geli\u015ftirme konsolunda bir uyar\u0131 belirecektir.<\/p>\n<h3>Temel PropType T\u00fcrleri<\/h3>\n<p><code>PropTypes<\/code> mod\u00fcl\u00fc, \u00e7e\u015fitli veri t\u00fcrlerini ve yap\u0131lar\u0131n\u0131 do\u011frulamak i\u00e7in bir dizi haz\u0131r do\u011frulay\u0131c\u0131 sunar. Bu do\u011frulay\u0131c\u0131lar, React bile\u015fenlerinize iletilen prop&#8217;lar\u0131n beklendi\u011fi gibi oldu\u011fundan emin olman\u0131z\u0131 sa\u011flar.<\/p>\n<h4>Primitive T\u00fcrler<\/h4>\n<p>JavaScript&#8217;teki temel veri t\u00fcrlerini temsil eden do\u011frulay\u0131c\u0131lard\u0131r:<\/p>\n<p>*   <strong><code>PropTypes.string<\/code><\/strong>: Prop&#8217;un bir string olmas\u0131n\u0131 bekler.<\/p>\n<pre><code class=\"language-javascript\">name: PropTypes.string<\/code><\/pre>\n<p>*   <strong><code>PropTypes.number<\/code><\/strong>: Prop&#8217;un bir say\u0131 olmas\u0131n\u0131 bekler.<\/p>\n<pre><code class=\"language-javascript\">age: PropTypes.number<\/code><\/pre>\n<p>*   <strong><code>PropTypes.bool<\/code><\/strong>: Prop&#8217;un bir boolean (true\/false) olmas\u0131n\u0131 bekler.<\/p>\n<pre><code class=\"language-javascript\">isActive: PropTypes.bool<\/code><\/pre>\n<p>*   <strong><code>PropTypes.symbol<\/code><\/strong>: Prop&#8217;un bir Symbol olmas\u0131n\u0131 bekler (ES6 Symbol&#8217;leri).<\/p>\n<pre><code class=\"language-javascript\">uniqueId: PropTypes.symbol<\/code><\/pre>\n<p>*   <strong><code>PropTypes.func<\/code><\/strong>: Prop&#8217;un bir fonksiyon olmas\u0131n\u0131 bekler.<\/p>\n<pre><code class=\"language-javascript\">onClick: PropTypes.func<\/code><\/pre>\n<p>*   <strong><code>PropTypes.object<\/code><\/strong>: Prop&#8217;un bir JavaScript nesnesi olmas\u0131n\u0131 bekler.<\/p>\n<pre><code class=\"language-javascript\">data: PropTypes.object<\/code><\/pre>\n<p>*   <strong><code>PropTypes.array<\/code><\/strong>: Prop&#8217;un bir dizi olmas\u0131n\u0131 bekler.<\/p>\n<pre><code class=\"language-javascript\">items: PropTypes.array<\/code><\/pre>\n<p>*   <strong><code>PropTypes.node<\/code><\/strong>: Render edilebilir herhangi bir React node&#8217;u (say\u0131lar, stringler, React elementleri, diziler veya fragmentler) bekler. Genellikle <code>children<\/code> prop&#8217;u i\u00e7in kullan\u0131l\u0131r.<\/p>\n<pre><code class=\"language-javascript\">children: PropTypes.node<\/code><\/pre>\n<p>*   <strong><code>PropTypes.element<\/code><\/strong>: Bir React elementi (JSX ile olu\u015fturulan <code><MyComponent \/><\/code> gibi) bekler.<\/p>\n<pre><code class=\"language-javascript\">header: PropTypes.element<\/code><\/pre>\n<h4><code>isRequired<\/code> Kullan\u0131m\u0131<\/h4>\n<p>Varsay\u0131lan olarak, t\u00fcm prop&#8217;lar iste\u011fe ba\u011fl\u0131d\u0131r. Yani, bir prop belirtilmezse, React bir hata vermez. Ancak, baz\u0131 prop&#8217;lar\u0131n bile\u015fenin d\u00fczg\u00fcn \u00e7al\u0131\u015fmas\u0131 i\u00e7in mutlaka sa\u011flanmas\u0131 gerekebilir. Bu durumlarda, herhangi bir <code>PropTypes<\/code> do\u011frulay\u0131c\u0131s\u0131n\u0131n sonuna <code>.isRequired<\/code> ekleyerek o prop&#8217;un zorunlu oldu\u011funu belirtebilirsiniz.<\/p>\n<pre><code class=\"language-javascript\">MyComponent.propTypes = {\n  name: PropTypes.string.isRequired, \/\/ name prop'u zorunlu bir string olmal\u0131\n  age: PropTypes.number,             \/\/ age prop'u iste\u011fe ba\u011fl\u0131 bir say\u0131\n  onSave: PropTypes.func.isRequired, \/\/ onSave prop'u zorunlu bir fonksiyon olmal\u0131\n};<\/code><\/pre>\n<p>E\u011fer <code>name<\/code> veya <code>onSave<\/code> prop&#8217;lar\u0131 bile\u015fene iletilmezse, React geli\u015ftirme konsolunda bir uyar\u0131 g\u00f6sterecektir.<\/p>\n<h4>\u00d6rneklerle A\u00e7\u0131klama<\/h4>\n<pre><code class=\"language-javascript\">import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst UserProfile = (props) => {\n  return (\n    <div>\n      <h2>{props.name}<\/h2>\n      <p>Ya\u015f: {props.age}<\/p>\n      <p>Email: {props.email}<\/p>\n      <p>Aktif Kullan\u0131c\u0131: {props.isActive ? 'Evet' : 'Hay\u0131r'}<\/p>\n      <button onClick={props.onEdit}>Profili D\u00fczenle<\/button>\n      <div>{props.children}<\/div> {\/<em> children bir node <\/em>\/}\n    <\/div>\n  );\n};\n\nUserProfile.propTypes = {\n  name: PropTypes.string.isRequired,\n  age: PropTypes.number.isRequired,\n  email: PropTypes.string, \/\/ iste\u011fe ba\u011fl\u0131 string\n  isActive: PropTypes.bool, \/\/ iste\u011fe ba\u011fl\u0131 boolean\n  onEdit: PropTypes.func.isRequired,\n  children: PropTypes.node,\n};\n\n\/\/ Kullan\u0131m \u00f6rne\u011fi:\n\/\/ <UserProfile name=\"Ali Can\" age={30} email=\"ali@example.com\" isActive={true} onEdit={() => console.log('D\u00fczenle')} >\n\/\/   <p>Ek Bilgi<\/p>\n\/\/ <\/UserProfile>\n\n\/\/ Eksik veya yanl\u0131\u015f tipte prop ile kullan\u0131m:\n\/\/ <UserProfile age=\"otuz\" onEdit=\"fonksiyon degil\" \/> \/\/ Konsolda uyar\u0131 verir<\/code><\/pre>\n<p>Bu \u00f6rnek, temel <code>PropTypes<\/code> t\u00fcrlerinin nas\u0131l kullan\u0131laca\u011f\u0131n\u0131 ve <code>isRequired<\/code> ile zorunlu prop&#8217;lar\u0131n nas\u0131l tan\u0131mlanaca\u011f\u0131n\u0131 g\u00f6stermektedir.<\/p>\n<h3>Geli\u015fmi\u015f PropType T\u00fcrleri ve Kombinasyonlar<\/h3>\n<p><code>PropTypes<\/code> sadece temel veri t\u00fcrlerini de\u011fil, ayn\u0131 zamanda daha karma\u015f\u0131k veri yap\u0131lar\u0131n\u0131 ve kombinasyonlar\u0131n\u0131 do\u011frulamak i\u00e7in de g\u00fc\u00e7l\u00fc ara\u00e7lar sunar.<\/p>\n<h4>Koleksiyon T\u00fcrleri<\/h4>\n<p>*   <strong><code>PropTypes.arrayOf(PropTypes.number)<\/code><\/strong>: Belirli bir t\u00fcrdeki elemanlar\u0131 i\u00e7eren bir dizi bekler.<\/p>\n<pre><code class=\"language-javascript\">numbers: PropTypes.arrayOf(PropTypes.number), \/\/ Sadece say\u0131lardan olu\u015fan bir dizi\n    users: PropTypes.arrayOf(PropTypes.shape({ \/\/ Belirli bir \u015fekle sahip nesnelerden olu\u015fan bir dizi\n      id: PropTypes.number.isRequired,\n      name: PropTypes.string.isRequired,\n    })),<\/code><\/pre>\n<p>*   <strong><code>PropTypes.objectOf(PropTypes.number)<\/code><\/strong>: Belirli bir t\u00fcrdeki de\u011ferleri i\u00e7eren bir nesne bekler. Nesnenin anahtarlar\u0131 herhangi bir string olabilir, ancak de\u011ferleri belirtilen t\u00fcrde olmal\u0131d\u0131r.<\/p>\n<pre><code class=\"language-javascript\">scores: PropTypes.objectOf(PropTypes.number), \/\/ Anahtarlar\u0131 string, de\u011ferleri say\u0131 olan bir nesne<\/code><\/pre>\n<h4>Belirli \u015eekiller (Shapes) ve Nesneler<\/h4>\n<p>*   <strong><code>PropTypes.shape({ ... })<\/code><\/strong>: Bir nesnenin belirli bir &#8220;\u015fekle&#8221; sahip olmas\u0131n\u0131 bekler. Nesnenin i\u00e7indeki her bir anahtar\u0131n t\u00fcr\u00fcn\u00fc tan\u0131mlaman\u0131za olanak tan\u0131r.<\/p>\n<pre><code class=\"language-javascript\">user: PropTypes.shape({\n      id: PropTypes.number.isRequired,\n      name: PropTypes.string.isRequired,\n      email: PropTypes.string,\n    }),<\/code><\/pre>\n<p>    Bu do\u011frulay\u0131c\u0131, <code>user<\/code> nesnesinin <code>id<\/code> ve <code>name<\/code> anahtarlar\u0131n\u0131 zorunlu k\u0131lar ve <code>email<\/code> anahtar\u0131n\u0131 iste\u011fe ba\u011fl\u0131 bir string olarak kabul eder. <code>shape<\/code>, tan\u0131mlanmayan ek anahtarlar\u0131 g\u00f6rmezden gelir.<\/p>\n<p>*   <strong><code>PropTypes.exact({ ... })<\/code><\/strong>: <code>shape<\/code>&#8216;e benzer, ancak daha kat\u0131d\u0131r. Yaln\u0131zca tan\u0131mlanan anahtarlar\u0131n bulunmas\u0131na izin verir ve ek anahtarlar varsa uyar\u0131 verir.<\/p>\n<pre><code class=\"language-javascript\">config: PropTypes.exact({\n      theme: PropTypes.string.isRequired,\n      fontSize: PropTypes.number,\n    }),<\/code><\/pre>\n<p>    E\u011fer <code>config<\/code> nesnesinde <code>theme<\/code> ve <code>fontSize<\/code> d\u0131\u015f\u0131nda bir anahtar bulunursa, uyar\u0131 verilir.<\/p>\n<h4>Enum T\u00fcrleri<\/h4>\n<p>*   <strong><code>PropTypes.oneOf(['option1', 'option2', 'option3'])<\/code><\/strong>: Prop&#8217;un belirli bir de\u011fer listesinden biri olmas\u0131n\u0131 bekler.<\/p>\n<pre><code class=\"language-javascript\">status: PropTypes.oneOf(['pending', 'approved', 'rejected']).isRequired,<\/code><\/pre>\n<p>    Bu \u00f6rnekte, <code>status<\/code> prop&#8217;u sadece <code>'pending'<\/code>, <code>'approved'<\/code> veya <code>'rejected'<\/code> de\u011ferlerinden birini alabilir.<\/p>\n<h4>Birden Fazla T\u00fcr<\/h4>\n<p>*   <strong><code>PropTypes.oneOfType([PropTypes.string, PropTypes.number])<\/code><\/strong>: Prop&#8217;un belirtilen t\u00fcrlerden herhangi biri olmas\u0131n\u0131 bekler.<\/p>\n<pre><code class=\"language-javascript\">value: PropTypes.oneOfType([\n      PropTypes.string,\n      PropTypes.number,\n      PropTypes.bool,\n    ]).isRequired,<\/code><\/pre>\n<p>    <code>value<\/code> prop&#8217;u bir string, bir say\u0131 veya bir boolean olabilir.<\/p>\n<h4>Instance T\u00fcrleri<\/h4>\n<p>*   <strong><code>PropTypes.instanceOf(MyClass)<\/code><\/strong>: Prop&#8217;un belirli bir JavaScript s\u0131n\u0131f\u0131n\u0131n bir \u00f6rne\u011fi (instance) olmas\u0131n\u0131 bekler.<\/p>\n<pre><code class=\"language-javascript\">eventDate: PropTypes.instanceOf(Date).isRequired, \/\/ eventDate bir Date nesnesi olmal\u0131<\/code><\/pre>\n<p>    Bu, \u00f6zellikle \u00f6zel s\u0131n\u0131flar veya yerle\u015fik nesneler (\u00f6rne\u011fin <code>Date<\/code>, <code>RegExp<\/code>) ile \u00e7al\u0131\u015f\u0131rken kullan\u0131\u015fl\u0131d\u0131r.<\/p>\n<h4>Any T\u00fcr\u00fc<\/h4>\n<p>*   <strong><code>PropTypes.any<\/code><\/strong>: Prop&#8217;un herhangi bir veri t\u00fcr\u00fc olmas\u0131n\u0131 bekler. Genellikle tip kontrol\u00fcn\u00fc atlamak veya belirsiz durumlarda kullan\u0131l\u0131r, ancak \u00e7o\u011fu zaman daha spesifik bir do\u011frulay\u0131c\u0131 kullanmak tercih edilir.<\/p>\n<pre><code class=\"language-javascript\">genericProp: PropTypes.any, \/\/ Herhangi bir t\u00fcr\u00fc kabul eder<\/code><\/pre>\n<p>Bu geli\u015fmi\u015f do\u011frulay\u0131c\u0131lar, bile\u015fenlerinizin bekledi\u011fi prop yap\u0131lar\u0131n\u0131 daha ayr\u0131nt\u0131l\u0131 ve esnek bir \u015fekilde tan\u0131mlaman\u0131za olanak tan\u0131r, b\u00f6ylece daha sa\u011flam ve anla\u015f\u0131l\u0131r bile\u015fenler olu\u015fturabilirsiniz.<\/p>\n<h3>Fonksiyonel Bile\u015fenlerde PropType Kullan\u0131m\u0131<\/h3>\n<p>React&#8217;\u0131n modern geli\u015fimiyle birlikte fonksiyonel bile\u015fenler ve Hook&#8217;lar yayg\u0131nla\u015fm\u0131\u015ft\u0131r. <code>PropTypes<\/code>&#8216;\u0131n kullan\u0131m\u0131, s\u0131n\u0131f bile\u015fenleri ile fonksiyonel bile\u015fenler aras\u0131nda b\u00fcy\u00fck bir farkl\u0131l\u0131k g\u00f6stermez. <code>propTypes<\/code> ve <code>defaultProps<\/code> statik \u00f6zellikleri, her iki bile\u015fen t\u00fcr\u00fcnde de do\u011frudan bile\u015fen fonksiyonuna atanabilir.<\/p>\n<pre><code class=\"language-javascript\">import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst Greeting = ({ name, age }) => {\n  return (\n    <div>\n      Merhaba, ben {name}. {age} ya\u015f\u0131nday\u0131m.\n    <\/div>\n  );\n};\n\n\/\/ PropTypes'\u0131 fonksiyonel bile\u015fene do\u011frudan atama\nGreeting.propTypes = {\n  name: PropTypes.string.isRequired,\n  age: PropTypes.number,\n};\n\n\/\/ defaultProps'\u0131 da ayn\u0131 \u015fekilde atayabiliriz\nGreeting.defaultProps = {\n  age: 25, \/\/ E\u011fer age prop'u ge\u00e7ilmezse varsay\u0131lan olarak 25 kullan\u0131l\u0131r\n};\n\nexport default Greeting;<\/code><\/pre>\n<p>Bu \u00f6rnekte g\u00f6r\u00fcld\u00fc\u011f\u00fc gibi, <code>Greeting<\/code> fonksiyonel bile\u015feninin <code>propTypes<\/code> ve <code>defaultProps<\/code> \u00f6zellikleri, bile\u015fen tan\u0131m\u0131n\u0131n hemen alt\u0131na atanm\u0131\u015ft\u0131r. Bu, kodun okunabilirli\u011fini art\u0131r\u0131r ve hem s\u0131n\u0131f hem de fonksiyonel bile\u015fenler i\u00e7in tutarl\u0131 bir kullan\u0131m sa\u011flar.<\/p>\n<h3><code>defaultProps<\/code> ile Varsay\u0131lan De\u011ferler<\/h3>\n<p>Baz\u0131 prop&#8217;lar iste\u011fe ba\u011fl\u0131 olabilir ve e\u011fer iletilmezlerse bile\u015fenin yine de d\u00fczg\u00fcn \u00e7al\u0131\u015fmas\u0131n\u0131 sa\u011flamak i\u00e7in varsay\u0131lan bir de\u011fere sahip olmalar\u0131 gerekebilir. <code>defaultProps<\/code> \u00f6zelli\u011fi, bu senaryolar i\u00e7in ideal bir \u00e7\u00f6z\u00fcmd\u00fcr.<\/p>\n<h4><code>defaultProps<\/code> Nedir?<\/h4>\n<p><code>defaultProps<\/code>, bir React bile\u015fenine prop&#8217;lar iletilmedi\u011finde kullan\u0131lacak varsay\u0131lan de\u011ferleri tan\u0131mlaman\u0131z\u0131 sa\u011flayan statik bir \u00f6zelliktir. Bile\u015fene bir prop ge\u00e7ilmezse veya <code>undefined<\/code> olarak ge\u00e7ilirse, <code>defaultProps<\/code>&#8216;ta tan\u0131mlanan ilgili de\u011fer kullan\u0131l\u0131r.<\/p>\n<h4>Neden Kullan\u0131l\u0131r?<\/h4>\n<p>1.  <strong>Opsiyonel Prop&#8217;lar:<\/strong> Bile\u015fenin \u00e7al\u0131\u015fmas\u0131 i\u00e7in zorunlu olmayan prop&#8217;lar i\u00e7in g\u00fcvenli varsay\u0131lanlar sa\u011flamak.<br \/>\n2.  <strong>Daha Az Hata:<\/strong> <code>undefined<\/code> prop&#8217;lar nedeniyle olu\u015fabilecek hatalar\u0131 \u00f6nlemek.<br \/>\n3.  <strong>Daha Temiz Kod:<\/strong> Bile\u015fen i\u00e7inde her seferinde <code>prop ? prop : defaultValue<\/code> gibi kontrol ifadeleri yazmaktan ka\u00e7\u0131nmak.<br \/>\n4.  <strong>Dok\u00fcmantasyon:<\/strong> Bile\u015fenin hangi prop&#8217;lar i\u00e7in varsay\u0131lan de\u011ferlere sahip oldu\u011funu a\u00e7\u0131k\u00e7a belirtir.<\/p>\n<h4><code>propTypes<\/code> ile \u0130li\u015fkisi<\/h4>\n<p><code>defaultProps<\/code>, genellikle <code>propTypes<\/code> ile birlikte kullan\u0131l\u0131r. <code>propTypes<\/code> bir prop&#8217;un t\u00fcr\u00fcn\u00fc ve zorunlulu\u011funu belirtirken, <code>defaultProps<\/code> iste\u011fe ba\u011fl\u0131 prop&#8217;lar i\u00e7in bir &#8220;yedek&#8221; de\u011fer sa\u011flar. E\u011fer bir prop <code>isRequired<\/code> olarak tan\u0131mlanm\u0131\u015fsa ve <code>defaultProps<\/code>&#8216;ta da bir de\u011feri varsa, <code>isRequired<\/code> kontrol\u00fc hala ge\u00e7erli olur. Ancak, <code>defaultProps<\/code> de\u011feri, prop d\u0131\u015far\u0131dan ge\u00e7ilmedi\u011finde devreye girece\u011fi i\u00e7in, <code>isRequired<\/code> hatas\u0131 tetiklenmez. \u00c7\u00fcnk\u00fc React, <code>defaultProps<\/code> de\u011ferini bile\u015fene prop olarak iletmeden \u00f6nce uygular.<\/p>\n<pre><code class=\"language-javascript\">import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst Button = ({ label, color, onClick }) => {\n  const buttonStyle = {\n    backgroundColor: color,\n    padding: '10px 20px',\n    borderRadius: '5px',\n    color: 'white',\n    border: 'none',\n    cursor: 'pointer',\n  };\n\n  return (\n    <button style={buttonStyle} onClick={onClick}>\n      {label}\n    <\/button>\n  );\n};\n\nButton.propTypes = {\n  label: PropTypes.string.isRequired,\n  color: PropTypes.string, \/\/ iste\u011fe ba\u011fl\u0131 string\n  onClick: PropTypes.func,  \/\/ iste\u011fe ba\u011fl\u0131 fonksiyon\n};\n\nButton.defaultProps = {\n  color: 'blue',           \/\/ color prop'u ge\u00e7ilmezse varsay\u0131lan mavi olur\n  onClick: () => console.log('Butona t\u0131kland\u0131!'), \/\/ onClick prop'u ge\u00e7ilmezse bu fonksiyon \u00e7al\u0131\u015f\u0131r\n};\n\nexport default Button;<\/code><\/pre>\n<p>Bu \u00f6rnekte, <code>Button<\/code> bile\u015feninin <code>label<\/code> prop&#8217;u zorunludur. Ancak <code>color<\/code> ve <code>onClick<\/code> prop&#8217;lar\u0131 iste\u011fe ba\u011fl\u0131d\u0131r ve e\u011fer d\u0131\u015far\u0131dan bir de\u011fer iletilmezse, <code>defaultProps<\/code>&#8216;ta tan\u0131mlanan <code>'blue'<\/code> rengi ve varsay\u0131lan <code>onClick<\/code> fonksiyonu kullan\u0131l\u0131r. Bu sayede, bile\u015fen her zaman ge\u00e7erli bir <code>color<\/code> ve <code>onClick<\/code> prop&#8217;una sahip olur.<\/p>\n<h3>\u00d6zel Do\u011frulay\u0131c\u0131lar (Custom Validators) Olu\u015fturma<\/h3>\n<p><code>PropTypes<\/code>&#8216;\u0131n sundu\u011fu yerle\u015fik do\u011frulay\u0131c\u0131lar \u00e7o\u011fu senaryo i\u00e7in yeterli olsa da, bazen daha karma\u015f\u0131k veya uygulamaya \u00f6zg\u00fc do\u011frulama mant\u0131\u011f\u0131na ihtiya\u00e7 duyulabilir. Bu gibi durumlarda, kendi \u00f6zel do\u011frulay\u0131c\u0131lar\u0131n\u0131z\u0131 yazabilirsiniz.<\/p>\n<h4>Ne Zaman \u0130htiya\u00e7 Duyulur?<\/h4>\n<p>*   Belirli bir formatta (\u00f6rne\u011fin, e-posta adresi, telefon numaras\u0131) bir string do\u011frulamak.<br \/>\n*   Bir say\u0131n\u0131n belirli bir aral\u0131kta olup olmad\u0131\u011f\u0131n\u0131 kontrol etmek.<br \/>\n*   Bir nesnenin belirli bir kombinasyonda anahtarlara sahip olup olmad\u0131\u011f\u0131n\u0131 do\u011frulamak.<br \/>\n*   Birden fazla prop&#8217;un birbirine ba\u011f\u0131ml\u0131 oldu\u011fu durumlar\u0131 kontrol etmek.<\/p>\n<h4>Nas\u0131l Olu\u015fturulur?<\/h4>\n<p>\u00d6zel bir do\u011frulay\u0131c\u0131, a\u015fa\u011f\u0131daki imzaya sahip bir fonksiyon d\u00f6nd\u00fcren bir fonksiyondur:<\/p>\n<pre><code class=\"language-javascript\">function (props, propName, componentName, location, propFullName) {\n  \/\/ Do\u011frulama mant\u0131\u011f\u0131 buraya gelir\n  \/\/ E\u011fer do\u011frulama ba\u015far\u0131s\u0131z olursa bir Error nesnesi d\u00f6nd\u00fcr\u00fcl\u00fcr\n  \/\/ Ba\u015far\u0131l\u0131 olursa undefined d\u00f6nd\u00fcr\u00fcl\u00fcr\n}<\/code><\/pre>\n<p>Bu fonksiyonun parametreleri \u015funlard\u0131r:<\/p>\n<p>*   <code>props<\/code>: Bile\u015fene iletilen t\u00fcm prop&#8217;lar\u0131 i\u00e7eren nesne.<br \/>\n*   <code>propName<\/code>: Do\u011frulanmakta olan prop&#8217;un ad\u0131 (string).<br \/>\n*   <code>componentName<\/code>: Prop&#8217;un ait oldu\u011fu bile\u015fenin ad\u0131 (string).<br \/>\n*   <code>location<\/code>: Prop&#8217;un konumu (genellikle <code>'prop'<\/code>).<br \/>\n*   <code>propFullName<\/code>: Prop&#8217;un tam ad\u0131 (genellikle <code>propName<\/code> ile ayn\u0131, ancak i\u00e7 i\u00e7e ge\u00e7mi\u015f prop&#8217;lar i\u00e7in farkl\u0131 olabilir).<\/p>\n<p>E\u011fer do\u011frulama ba\u015far\u0131s\u0131z olursa, fonksiyon bir <code>Error<\/code> nesnesi d\u00f6nd\u00fcrmelidir. Bu <code>Error<\/code> nesnesinin mesaj\u0131, geli\u015ftirme konsolunda uyar\u0131 olarak g\u00f6r\u00fcn\u00fcr. Do\u011frulama ba\u015far\u0131l\u0131 olursa <code>undefined<\/code> d\u00f6nd\u00fcr\u00fclmelidir.<\/p>\n<h4>\u00d6rnek: E-posta Do\u011frulay\u0131c\u0131<\/h4>\n<p>Bir e-posta adresinin ge\u00e7erli bir formatta olup olmad\u0131\u011f\u0131n\u0131 kontrol eden bir do\u011frulay\u0131c\u0131 yazal\u0131m:<\/p>\n<pre><code class=\"language-javascript\">import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst EmailInput = ({ email }) => {\n  return (\n    <div>\n      <label>Email:<\/label>\n      <input type=\"text\" value={email} readOnly \/>\n      {email && <p>Ge\u00e7erli email: {email}<\/p>}\n    <\/div>\n  );\n};\n\n\/\/ \u00d6zel e-posta do\u011frulay\u0131c\u0131 fonksiyonu\nconst validateEmail = (props, propName, componentName) => {\n  if (!\/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$\/.test(props[propName])) {\n    return new Error(\n      <code>Invalid prop '${propName}' supplied to '${componentName}'. Email format is incorrect.<\/code>\n    );\n  }\n  return undefined; \/\/ Do\u011frulama ba\u015far\u0131l\u0131\n};\n\nEmailInput.propTypes = {\n  email: validateEmail, \/\/ \u00d6zel do\u011frulay\u0131c\u0131y\u0131 kullanma\n};\n\nexport default EmailInput;\n\n\/\/ Kullan\u0131m \u00f6rne\u011fi:\n\/\/ <EmailInput email=\"test@example.com\" \/> \/\/ Ge\u00e7erli\n\/\/ <EmailInput email=\"invalid-email\" \/>     \/\/ Konsolda uyar\u0131 verir<\/code><\/pre>\n<p>Bu \u00f6rnekte, <code>validateEmail<\/code> ad\u0131nda \u00f6zel bir do\u011frulay\u0131c\u0131 fonksiyonu tan\u0131mlanm\u0131\u015ft\u0131r. Bu fonksiyon, bir e-posta adresinin temel regex format\u0131na uyup uymad\u0131\u011f\u0131n\u0131 kontrol eder. E\u011fer uymazsa bir <code>Error<\/code> nesnesi d\u00f6nd\u00fcr\u00fcr.<\/p>\n<h4><code>isRequired<\/code> ile Kombinasyon<\/h4>\n<p>\u00d6zel do\u011frulay\u0131c\u0131lar\u0131 <code>isRequired<\/code> ile birlikte kullanmak m\u00fcmk\u00fcnd\u00fcr. Bunun i\u00e7in, \u00f6zel do\u011frulay\u0131c\u0131n\u0131z\u0131 bir fonksiyon olarak tan\u0131mlar ve ard\u0131ndan <code>isRequired<\/code> \u00f6zelli\u011fini eklersiniz.<\/p>\n<pre><code class=\"language-javascript\">import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst NumberRangeInput = ({ value }) => {\n  return (\n    <div>\n      <label>De\u011fer:<\/label>\n      <input type=\"number\" value={value} readOnly \/>\n      <p>Girilen de\u011fer: {value}<\/p>\n    <\/div>\n  );\n};\n\nconst numberInRange = (min, max) => (props, propName, componentName) => {\n  const propValue = props[propName];\n  if (typeof propValue !== 'number' || propValue < min || propValue > max) {\n    return new Error(\n      <code>Invalid prop '${propName}' supplied to '${componentName}'. <\/code> +\n      <code>Value must be a number between ${min} and ${max}.<\/code>\n    );\n  }\n  return undefined;\n};\n\nNumberRangeInput.propTypes = {\n  value: numberInRange(0, 100).isRequired, \/\/ 0-100 aras\u0131nda zorunlu bir say\u0131\n};\n\nexport default NumberRangeInput;\n\n\/\/ Kullan\u0131m \u00f6rne\u011fi:\n\/\/ <NumberRangeInput value={50} \/>   \/\/ Ge\u00e7erli\n\/\/ <NumberRangeInput value={-5} \/>   \/\/ Konsolda uyar\u0131 verir\n\/\/ <NumberRangeInput value={150} \/>  \/\/ Konsolda uyar\u0131 verir\n\/\/ <NumberRangeInput \/>             \/\/ Konsolda isRequired uyar\u0131s\u0131 verir<\/code><\/pre>\n<p>Bu \u00f6rnekte, <code>numberInRange<\/code> ad\u0131nda bir fonksiyon, <code>min<\/code> ve <code>max<\/code> de\u011ferlerini alarak yeni bir do\u011frulay\u0131c\u0131 fonksiyonu d\u00f6nd\u00fcr\u00fcr. Bu sayede, farkl\u0131 aral\u0131klar i\u00e7in kolayca do\u011frulay\u0131c\u0131lar olu\u015fturulabilir. <code>.isRequired<\/code> eklenerek bu do\u011frulay\u0131c\u0131n\u0131n zorunlu oldu\u011fu belirtilmi\u015ftir.<\/p>\n<p>\u00d6zel do\u011frulay\u0131c\u0131lar, <code>PropTypes<\/code>&#8216;\u0131 karma\u015f\u0131k senaryolarda bile olduk\u00e7a esnek ve g\u00fc\u00e7l\u00fc hale getirir. Ancak, bu t\u00fcr do\u011frulay\u0131c\u0131lar\u0131n bak\u0131m\u0131 ve test edilmesi, yerle\u015fik do\u011frulay\u0131c\u0131lara g\u00f6re daha fazla \u00e7aba gerektirebilir.<\/p>\n<h3>Geli\u015ftirme Ortam\u0131 ve Hata Mesajlar\u0131<\/h3>\n<p><code>PropTypes<\/code>&#8216;\u0131n \u00f6nemli bir \u00f6zelli\u011fi, sadece geli\u015ftirme (development) ortam\u0131nda \u00e7al\u0131\u015fmas\u0131d\u0131r. \u00dcretim (production) ortam\u0131na da\u011f\u0131t\u0131lan uygulamalarda, <code>PropTypes<\/code> kontrolleri otomatik olarak devre d\u0131\u015f\u0131 b\u0131rak\u0131l\u0131r ve koddan \u00e7\u0131kar\u0131l\u0131r.<\/p>\n<h4>Neden Sadece Geli\u015ftirme Modunda?<\/h4>\n<p>*   <strong>Performans:<\/strong> Tip kontrol\u00fc, \u00e7al\u0131\u015fma zaman\u0131nda ek bir maliyet getirir. \u00dcretim ortam\u0131nda bu maliyetin olmamas\u0131, uygulaman\u0131n daha h\u0131zl\u0131 \u00e7al\u0131\u015fmas\u0131n\u0131 sa\u011flar.<br \/>\n*   <strong>Hata Ay\u0131klama:<\/strong> Geli\u015ftirme a\u015famas\u0131nda hatalar\u0131 yakalamak \u00f6nemlidir, ancak son kullan\u0131c\u0131lar\u0131n bu uyar\u0131lar\u0131 g\u00f6rmesine gerek yoktur.<\/p>\n<p>Bu davran\u0131\u015f, Webpack gibi modern build ara\u00e7lar\u0131 sayesinde otomatik olarak y\u00f6netilir. <code>process.env.NODE_ENV<\/code> de\u011fi\u015fkeni <code>production<\/code> olarak ayarland\u0131\u011f\u0131nda, <code>prop-types<\/code> paketi i\u00e7indeki kontrol kodlar\u0131 elenir.<\/p>\n<h4>Taray\u0131c\u0131 Konsolunda G\u00f6r\u00fcnen Uyar\u0131lar<\/h4>\n<p>Bir <code>PropTypes<\/code> do\u011frulama hatas\u0131 meydana geldi\u011finde, React taray\u0131c\u0131n\u0131n geli\u015ftirici konsolunda a\u00e7\u0131klay\u0131c\u0131 bir uyar\u0131 mesaj\u0131 g\u00f6sterir. Bu mesajlar, hatan\u0131n nedenini, hangi prop&#8217;ta meydana geldi\u011fini ve hangi bile\u015fenin etkilendi\u011fini belirtir.<\/p>\n<p><strong>\u00d6rnek bir hata mesaj\u0131:<\/strong><\/p>\n<pre><code class=\"language-\">Warning: Failed prop type: Invalid prop <code>age<\/code> of type <code>string<\/code> supplied to <code>UserProfile<\/code>, expected <code>number<\/code>.\n    at UserProfile (http:\/\/localhost:3000\/static\/js\/bundle.js:103:7)\n    at div\n    at App (http:\/\/localhost:3000\/static\/js\/bundle.js:77:7)<\/code><\/pre>\n<p>Bu mesaj, <code>UserProfile<\/code> bile\u015fenine <code>age<\/code> prop&#8217;unun bir <code>string<\/code> olarak verildi\u011fini, oysa bir <code>number<\/code> beklendi\u011fini a\u00e7\u0131k\u00e7a belirtir. Hata mesaj\u0131nda ayr\u0131ca, hatan\u0131n kaynakland\u0131\u011f\u0131 bile\u015fen ve dosya yolu da genellikle bulunur, bu da hata ay\u0131klamay\u0131 kolayla\u015ft\u0131r\u0131r.<\/p>\n<p>Bu uyar\u0131lar, geli\u015ftirme s\u00fcrecinde s\u00fcrekli olarak izlenmeli ve d\u00fczeltilmelidir. Konsolda bu t\u00fcr uyar\u0131lar\u0131n olmamas\u0131, bile\u015fenlerinizin prop s\u00f6zle\u015fmelerine uygun \u00e7al\u0131\u015ft\u0131\u011f\u0131 anlam\u0131na gelir.<\/p>\n<h3>PropTypes&#8217;\u0131n Avantajlar\u0131 ve Dezavantajlar\u0131<\/h3>\n<p>Her ara\u00e7 gibi, <code>PropTypes<\/code>&#8216;\u0131n da kendine g\u00f6re avantajlar\u0131 ve dezavantajlar\u0131 vard\u0131r. Bunlar\u0131 bilmek, projeniz i\u00e7in do\u011fru tip kontrol \u00e7\u00f6z\u00fcm\u00fcn\u00fc se\u00e7menize yard\u0131mc\u0131 olur.<\/p>\n<h4>Avantajlar<\/h4>\n<p>1.  <strong>Hata Yakalama ve \u00d6nleme:<\/strong> Geli\u015ftirme a\u015famas\u0131nda prop hatalar\u0131n\u0131 erken tespit ederek \u00e7al\u0131\u015fma zaman\u0131 hatalar\u0131n\u0131 azalt\u0131r. Bu, \u00f6zellikle b\u00fcy\u00fck ekiplerde veya karma\u015f\u0131k bile\u015fen hiyerar\u015filerinde \u00e7ok de\u011ferlidir.<br \/>\n2.  <strong>Dok\u00fcmantasyon:<\/strong> <code>propTypes<\/code> tan\u0131mlar\u0131, bile\u015fenin bekledi\u011fi veriler hakk\u0131nda a\u00e7\u0131k ve okunabilir bir dok\u00fcmantasyon g\u00f6revi g\u00f6r\u00fcr. Bile\u015fenin &#8220;API s\u00f6zle\u015fmesini&#8221; net bir \u015fekilde belirtir.<br \/>\n3.  <strong>Kod Bak\u0131m\u0131n\u0131 Kolayla\u015ft\u0131rma:<\/strong> Bile\u015fenlerinizi gelecekte de\u011fi\u015ftirmek veya ba\u015fkalar\u0131n\u0131n kullanmas\u0131n\u0131 sa\u011flamak daha kolay hale gelir, \u00e7\u00fcnk\u00fc prop gereksinimleri a\u00e7\u0131k\u00e7a belirtilmi\u015ftir.<br \/>\n4.  <strong>D\u00fc\u015f\u00fck \u00d6\u011frenme E\u011frisi:<\/strong> JavaScript&#8217;e a\u015fina olan geli\u015ftiriciler i\u00e7in <code>PropTypes<\/code>&#8216;\u0131 \u00f6\u011frenmek ve kullanmak olduk\u00e7a kolayd\u0131r. Ek bir dil veya karma\u015f\u0131k yap\u0131land\u0131rma gerektirmez.<br \/>\n5.  <strong>React Ekosistemine Entegrasyon:<\/strong> React&#8217;\u0131n kendisiyle uyumlu olacak \u015fekilde tasarlanm\u0131\u015ft\u0131r ve React geli\u015ftirme ara\u00e7lar\u0131yla sorunsuz \u00e7al\u0131\u015f\u0131r.<br \/>\n6.  <strong>Geli\u015ftirme Modunda Etkili:<\/strong> Sadece geli\u015ftirme modunda \u00e7al\u0131\u015ft\u0131\u011f\u0131 i\u00e7in \u00fcretim ortam\u0131nda performans maliyeti yaratmaz.<\/p>\n<h4>Dezavantajlar<\/h4>\n<p>1.  <strong>Sadece \u00c7al\u0131\u015fma Zaman\u0131 (Runtime) Do\u011frulamas\u0131:<\/strong> <code>PropTypes<\/code>, kod \u00e7al\u0131\u015ft\u0131r\u0131ld\u0131\u011f\u0131nda do\u011frulama yapar. Bu, hatalar\u0131n derleme zaman\u0131nda (compile-time) de\u011fil, ancak uygulama \u00e7al\u0131\u015f\u0131rken fark edildi\u011fi anlam\u0131na gelir. Bu durum, statik tip denetleyicilerine (TypeScript, Flow) g\u00f6re daha ge\u00e7 hata tespiti demektir.<br \/>\n2.  <strong>Derleme Zaman\u0131 (Compile-time) Kontrol\u00fc Yok:<\/strong> IDE&#8217;lerde veya edit\u00f6rlerde otomatik tamamlama (autocompletion) veya an\u0131nda hata geri bildirimi (instant feedback) sa\u011flamaz. Prop&#8217;lar\u0131 yanl\u0131\u015f yazd\u0131\u011f\u0131n\u0131zda veya eksik b\u0131rakt\u0131\u011f\u0131n\u0131zda, hatay\u0131 ancak uygulamay\u0131 \u00e7al\u0131\u015ft\u0131rd\u0131\u011f\u0131n\u0131zda konsolda g\u00f6r\u00fcrs\u00fcn\u00fcz.<br \/>\n3.  <strong>Ekstra Kod Y\u00fck\u00fc (Geli\u015ftirme Modunda):<\/strong> Her ne kadar \u00fcretim ortam\u0131nda elense de, geli\u015ftirme ortam\u0131nda <code>PropTypes<\/code> kodunun paketinize dahil olmas\u0131, geli\u015ftirme server&#8217;\u0131n\u0131n daha yava\u015f ba\u015flamas\u0131na veya bundle boyutunun artmas\u0131na neden olabilir.<br \/>\n4.  <strong>Karma\u015f\u0131k Senaryolarda Yetersizlik:<\/strong> \u00c7ok karma\u015f\u0131k tip senaryolar\u0131 (\u00f6rne\u011fin, ko\u015fullu tipler, jenerik tipler) i\u00e7in <code>PropTypes<\/code>&#8216;\u0131n yetenekleri s\u0131n\u0131rl\u0131 kalabilir. \u00d6zel do\u011frulay\u0131c\u0131lar yazmak bu durumu bir nebze giderse de, kod karma\u015f\u0131kl\u0131\u011f\u0131n\u0131 art\u0131r\u0131r.<br \/>\n5.  <strong>Modern Alternatiflerin Var Olmas\u0131:<\/strong> TypeScript ve Flow gibi statik tip denetleyicileri, <code>PropTypes<\/code>&#8216;\u0131n sundu\u011fu t\u00fcm avantajlar\u0131 (ve daha fazlas\u0131n\u0131) derleme zaman\u0131nda sunar. Bu, bir\u00e7ok modern React projesinde <code>PropTypes<\/code> yerine bu ara\u00e7lar\u0131n tercih edilmesine yol a\u00e7m\u0131\u015ft\u0131r.<\/p>\n<h3>PropTypes ve Modern Tip Kontrol\u00fc \u00c7\u00f6z\u00fcmleri<\/h3>\n<p><code>PropTypes<\/code> uzun y\u0131llar boyunca React projelerinde tip kontrol\u00fcn\u00fcn temel ta\u015f\u0131 olmu\u015ftur. Ancak son y\u0131llarda TypeScript ve Flow gibi statik tip denetleyicilerinin y\u00fckseli\u015fiyle birlikte, <code>PropTypes<\/code>&#8216;\u0131n rol\u00fc ve kullan\u0131m alanlar\u0131 yeniden de\u011ferlendirilmektedir.<\/p>\n<h4>TypeScript ve Flow ile Kar\u015f\u0131la\u015ft\u0131rma<\/h4>\n<p>*   <strong>Temel Fark: Statik vs. Dinamik Tip Kontrol\u00fc<\/strong><br \/>\n    *   <strong>PropTypes (Dinamik\/Runtime):<\/strong> Tip kontrol\u00fcn\u00fc uygulama \u00e7al\u0131\u015fma zaman\u0131nda (runtime) ger\u00e7ekle\u015ftirir. Hatalar\u0131 taray\u0131c\u0131 konsolunda uyar\u0131 olarak g\u00f6sterir.<br \/>\n    *   <strong>TypeScript\/Flow (Statik\/Compile-time):<\/strong> Tip kontrol\u00fcn\u00fc kod yaz\u0131l\u0131rken veya derleme a\u015famas\u0131nda (compile-time) ger\u00e7ekle\u015ftirir. Hatalar\u0131 kod edit\u00f6r\u00fcnde an\u0131nda g\u00f6sterir ve uygulaman\u0131n derlenmesini engelleyebilir.<\/p>\n<p>*   <strong>Sundu\u011fu \u00d6zellikler<\/strong><br \/>\n    *   <strong>PropTypes:<\/strong> Yaln\u0131zca prop do\u011frulama sa\u011flar.<br \/>\n    *   <strong>TypeScript\/Flow:<\/strong> Prop do\u011frulamaya ek olarak, de\u011fi\u015fkenler, fonksiyon arg\u00fcmanlar\u0131, d\u00f6n\u00fc\u015f de\u011ferleri, s\u0131n\u0131f \u00fcyeleri ve daha fazlas\u0131 i\u00e7in tip kontrol\u00fc sunar. Aray\u00fczler (interfaces), tip takma adlar\u0131 (type aliases), jenerik tipler (generics) gibi geli\u015fmi\u015f \u00f6zelliklerle kodun tamam\u0131nda tip g\u00fcvenli\u011fi sa\u011flar. Geli\u015fmi\u015f refactoring yetenekleri ve IDE entegrasyonu sayesinde geli\u015ftirici deneyimini \u00f6nemli \u00f6l\u00e7\u00fcde art\u0131r\u0131r.<\/p>\n<p>*   <strong>Geli\u015ftirici Deneyimi<\/strong><br \/>\n    *   <strong>PropTypes:<\/strong> Hatalar\u0131 yaln\u0131zca uygulamay\u0131 \u00e7al\u0131\u015ft\u0131rd\u0131\u011f\u0131n\u0131zda ve ilgili bile\u015fen render edildi\u011finde g\u00f6r\u00fcrs\u00fcn\u00fcz. IDE deste\u011fi s\u0131n\u0131rl\u0131d\u0131r.<br \/>\n    *   <strong>TypeScript\/Flow:<\/strong> Kod yazarken an\u0131nda geri bildirim al\u0131rs\u0131n\u0131z. IDE&#8217;ler, tip tan\u0131mlar\u0131na dayanarak otomatik tamamlama, hata vurgulama ve kod navigasyonu gibi g\u00fc\u00e7l\u00fc \u00f6zellikler sunar. Bu, hatalar\u0131 daha erken ve daha h\u0131zl\u0131 yakalaman\u0131z\u0131 sa\u011flar.<\/p>\n<p>*   <strong>Performans<\/strong><br \/>\n    *   <strong>PropTypes:<\/strong> Geli\u015ftirme modunda bir performans maliyeti vard\u0131r, ancak \u00fcretim modunda bu kod kald\u0131r\u0131l\u0131r.<br \/>\n    *   <strong>TypeScript\/Flow:<\/strong> Derleme a\u015famas\u0131nda bir maliyeti vard\u0131r (kodun transpiling s\u00fcresi), ancak \u00e7al\u0131\u015fma zaman\u0131nda ek bir performans maliyeti yoktur, \u00e7\u00fcnk\u00fc tipler JavaScript&#8217;e d\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcrken kald\u0131r\u0131l\u0131r.<\/p>\n<h4>Ne Zaman Hangisini Kullanmal\u0131?<\/h4>\n<p>*   <strong>PropTypes&#8217;\u0131 Kullan\u0131n E\u011fer:<\/strong><br \/>\n    *   K\u00fc\u00e7\u00fck, basit bir proje geli\u015ftiriyorsan\u0131z ve statik tip kontrol\u00fcn\u00fcn karma\u015f\u0131kl\u0131\u011f\u0131na girmek istemiyorsan\u0131z.<br \/>\n    *   Mevcut bir JavaScript projesinde \u00e7al\u0131\u015f\u0131yorsan\u0131z ve TypeScript\/Flow&#8217;a ge\u00e7i\u015f yapmak b\u00fcy\u00fck bir efor gerektiriyorsa.<br \/>\n    *   Ekibinizdeki herkes JavaScript konusunda rahatsa ancak statik tip kontrol\u00fc konusunda deneyimi yoksa.<br \/>\n    *   Sadece bile\u015fen prop&#8217;lar\u0131 i\u00e7in h\u0131zl\u0131 ve basit bir do\u011frulama ar\u0131yorsan\u0131z.<\/p>\n<p>*   <strong>TypeScript veya Flow&#8217;u Kullan\u0131n E\u011fer:<\/strong><br \/>\n    *   B\u00fcy\u00fck, karma\u015f\u0131k ve uzun \u00f6m\u00fcrl\u00fc bir proje \u00fczerinde \u00e7al\u0131\u015f\u0131yorsan\u0131z.<br \/>\n    *   Uygulaman\u0131n \u00f6l\u00e7eklenebilirli\u011fini ve bak\u0131m\u0131n\u0131 art\u0131rmak istiyorsan\u0131z.<br \/>\n    *   Geli\u015ftirme s\u00fcrecinde daha g\u00fc\u00e7l\u00fc hata tespiti ve daha iyi IDE deste\u011fi ar\u0131yorsan\u0131z.<br \/>\n    *   Ekibiniz statik tip kontrol\u00fc konusunda deneyimliyse veya \u00f6\u011frenmeye istekliyse.<br \/>\n    *   Kod taban\u0131n\u0131z\u0131n tamam\u0131nda tip g\u00fcvenli\u011fi sa\u011flamak istiyorsan\u0131z, sadece prop&#8217;lar i\u00e7in de\u011fil.<\/p>\n<p><strong>\u00d6nemli Not:<\/strong> Modern React projelerinde, \u00f6zellikle b\u00fcy\u00fck \u00f6l\u00e7eklilerde, TypeScript veya Flow kullan\u0131m\u0131 standart haline gelmi\u015ftir. Bu ara\u00e7lar, <code>PropTypes<\/code>&#8216;\u0131n sundu\u011fu prop do\u011frulama i\u015flevselli\u011fini (ve \u00e7ok daha fazlas\u0131n\u0131) derleme zaman\u0131nda sa\u011flad\u0131\u011f\u0131 i\u00e7in, genellikle <code>PropTypes<\/code>&#8216;\u0131 gereksiz k\u0131lar. Ancak, <code>PropTypes<\/code>&#8216;\u0131n temelini anlamak, React&#8217;\u0131n tarihsel geli\u015fimini ve tip kontrol\u00fcne yakla\u015f\u0131m\u0131n\u0131 kavramak a\u00e7\u0131s\u0131ndan hala de\u011ferlidir.<\/p>\n<h3>En \u0130yi Uygulamalar ve \u0130pu\u00e7lar\u0131<\/h3>\n<p><code>PropTypes<\/code> kullan\u0131rken kodunuzu daha okunabilir, bak\u0131m\u0131 kolay ve hatas\u0131z hale getirmek i\u00e7in baz\u0131 en iyi uygulamalar\u0131 takip edebilirsiniz:<\/p>\n<p>1.  <strong>Her Zaman <code>isRequired<\/code> Kullanmaya \u00c7al\u0131\u015f\u0131n:<\/strong> Bir prop&#8217;un bile\u015fenin d\u00fczg\u00fcn \u00e7al\u0131\u015fmas\u0131 i\u00e7in zorunlu oldu\u011funu d\u00fc\u015f\u00fcn\u00fcyorsan\u0131z, <code>isRequired<\/code> ile i\u015faretleyin. Bu, hatalar\u0131 erken yakalaman\u0131za yard\u0131mc\u0131 olur.<br \/>\n2.  <strong>Karma\u015f\u0131k Nesneler \u0130\u00e7in <code>shape<\/code> Kullan\u0131n:<\/strong> E\u011fer bir prop bir nesneyse ve bu nesnenin belirli bir yap\u0131s\u0131 olmas\u0131 gerekiyorsa, <code>PropTypes.shape<\/code> kullanarak i\u00e7indeki anahtarlar\u0131n tiplerini belirtin. Bu, nesnenin i\u00e7eri\u011fini dok\u00fcmante eder ve do\u011frular.<br \/>\n3.  <strong><code>defaultProps<\/code> ile Opsiyonel Prop&#8217;lar\u0131 Y\u00f6netin:<\/strong> \u0130ste\u011fe ba\u011fl\u0131 prop&#8217;lar i\u00e7in her zaman <code>defaultProps<\/code> kullanarak varsay\u0131lan de\u011ferler sa\u011flay\u0131n. Bu, bile\u015feninizin daha esnek olmas\u0131n\u0131 sa\u011flar ve <code>undefined<\/code> de\u011ferlerden kaynaklanan hatalar\u0131 \u00f6nler.<br \/>\n4.  <strong>\u00d6zel Do\u011frulay\u0131c\u0131lar\u0131 Dikkatli Kullan\u0131n:<\/strong> \u00d6zel do\u011frulay\u0131c\u0131lar g\u00fc\u00e7l\u00fcd\u00fcr, ancak karma\u015f\u0131kl\u0131\u011f\u0131 art\u0131rabilir. Yaln\u0131zca yerle\u015fik do\u011frulay\u0131c\u0131lar\u0131n yeterli olmad\u0131\u011f\u0131 durumlarda kullan\u0131n ve okunabilir, test edilebilir olmas\u0131na \u00f6zen g\u00f6sterin.<br \/>\n5.  <strong>Bile\u015fenlerinizi Mod\u00fcler Tutun:<\/strong> Her bile\u015fenin tek bir sorumlulu\u011fu olmal\u0131 ve ald\u0131\u011f\u0131 prop&#8217;lar net bir \u015fekilde tan\u0131mlanmal\u0131d\u0131r. Bu, <code>propTypes<\/code> tan\u0131mlar\u0131n\u0131 daha y\u00f6netilebilir hale getirir.<br \/>\n6.  <strong>PropType Tan\u0131mlar\u0131n\u0131 Bile\u015fenin Hemen Alt\u0131na Yerle\u015ftirin:<\/strong> <code>propTypes<\/code> ve <code>defaultProps<\/code> tan\u0131mlar\u0131n\u0131 ilgili bile\u015fenin hemen alt\u0131na yerle\u015ftirmek, kodun okunabilirli\u011fini art\u0131r\u0131r ve ilgili bilgilerin tek bir yerde bulunmas\u0131n\u0131 sa\u011flar.<br \/>\n7.  <strong>D\u0131\u015fa Aktar\u0131lan Bile\u015fenler \u0130\u00e7in <code>propTypes<\/code> Tan\u0131mlar\u0131n\u0131 D\u0131\u015fa Aktar\u0131n:<\/strong> Storybook gibi ara\u00e7lar veya otomatik dok\u00fcmantasyon olu\u015fturucular kullan\u0131yorsan\u0131z, <code>propTypes<\/code> tan\u0131mlar\u0131n\u0131 da d\u0131\u015fa aktarman\u0131z faydal\u0131 olabilir.<br \/>\n8.  <strong>Tutarl\u0131l\u0131k:<\/strong> Projeniz genelinde <code>PropTypes<\/code> kullan\u0131m\u0131nda tutarl\u0131 olun. Bu, ekibinizin kod taban\u0131n\u0131 daha kolay anlamas\u0131na ve bak\u0131m\u0131n\u0131 yapmas\u0131na yard\u0131mc\u0131 olur.<br \/>\n9.  <strong>Yorumlarla Destekleyin:<\/strong> \u00d6zellikle karma\u015f\u0131k <code>PropTypes<\/code> tan\u0131mlar\u0131 veya \u00f6zel do\u011frulay\u0131c\u0131lar i\u00e7in a\u00e7\u0131klay\u0131c\u0131 yorumlar eklemek, gelecekteki bak\u0131m\u0131 kolayla\u015ft\u0131r\u0131r.<\/p>\n<pre><code class=\"language-javascript\">\/\/ \u0130yi bir kullan\u0131m \u00f6rne\u011fi\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nconst ProductCard = ({ product, onAddToCart, showDetailsButton }) => {\n  return (\n    <div className=\"product-card\">\n      <h3>{product.name}<\/h3>\n      <p>{product.description}<\/p>\n      <p>Fiyat: {product.price} TL<\/p>\n      <button onClick={() => onAddToCart(product.id)}>Sepete Ekle<\/button>\n      {showDetailsButton && <button>Detaylar\u0131 G\u00f6r<\/button>}\n    <\/div>\n  );\n};\n\nProductCard.propTypes = {\n  product: PropTypes.shape({\n    id: PropTypes.string.isRequired,\n    name: PropTypes.string.isRequired,\n    description: PropTypes.string,\n    price: PropTypes.number.isRequired,\n  }).isRequired,\n  onAddToCart: PropTypes.func.isRequired,\n  showDetailsButton: PropTypes.bool,\n};\n\nProductCard.defaultProps = {\n  showDetailsButton: true,\n};\n\nexport default ProductCard;<\/code><\/pre>\n<p>Bu \u00f6rnek, <code>shape<\/code> ile karma\u015f\u0131k bir nesnenin yap\u0131s\u0131n\u0131 tan\u0131mlamay\u0131, <code>isRequired<\/code> ile zorunlu prop&#8217;lar\u0131 belirtmeyi ve <code>defaultProps<\/code> ile iste\u011fe ba\u011fl\u0131 bir prop i\u00e7in varsay\u0131lan de\u011fer sa\u011flamay\u0131 g\u00f6stermektedir.<\/p>\n<h3>Sonu\u00e7<\/h3>\n<p><code>React.PropTypes<\/code>, React bile\u015fenlerinin prop&#8217;lar\u0131 i\u00e7in tip kontrol\u00fc ve do\u011frulama sa\u011flayan g\u00fc\u00e7l\u00fc ve basit bir mekanizmad\u0131r. Geli\u015ftirme s\u00fcrecinde hatalar\u0131 erken yakalayarak, kod kalitesini art\u0131rarak ve bile\u015fenler aras\u0131nda net bir &#8220;API s\u00f6zle\u015fmesi&#8221; olu\u015fturarak React geli\u015ftiricileri i\u00e7in \u00f6nemli avantajlar sunar.<\/p>\n<p>Her ne kadar TypeScript ve Flow gibi statik tip denetleyicileri modern React projelerinde daha kapsaml\u0131 \u00e7\u00f6z\u00fcmler sunsa da, <code>PropTypes<\/code> hala \u00f6\u011frenilmesi ve anla\u015f\u0131lmas\u0131 gereken de\u011ferli bir ara\u00e7t\u0131r. \u00d6zellikle mevcut projelerde, daha k\u00fc\u00e7\u00fck uygulamalarda veya statik tip kontrol\u00fcne ge\u00e7i\u015f yapmay\u0131 planlamayan ekipler i\u00e7in pratik ve etkili bir \u00e7\u00f6z\u00fcm olmaya devam etmektedir.<\/p>\n<p><code>PropTypes<\/code>&#8216;\u0131 do\u011fru bir \u015fekilde kullanmak, daha sa\u011flam, bak\u0131m\u0131 kolay ve okunabilir React uygulamalar\u0131 geli\u015ftirmenize yard\u0131mc\u0131 olacakt\u0131r. Bile\u015fenlerinizin bekledi\u011fi veri t\u00fcrlerini a\u00e7\u0131k\u00e7a tan\u0131mlayarak, hem kendinize hem de ekibinizdeki di\u011fer geli\u015ftiricilere b\u00fcy\u00fck bir kolayl\u0131k sa\u011flam\u0131\u015f olursunuz. Bu sayede, React bile\u015fenlerinizin g\u00fcvenilirli\u011fini art\u0131r\u0131rken, geli\u015ftirme s\u00fcrecinizi de daha verimli hale getirebilirsiniz.<\/body><\/p>\n","protected":false},"excerpt":{"rendered":"React.PropTypes Kullanarak Tiplerle \u00c7al\u0131\u015fmak: Kapsaml\u0131 Bir Rehber\nReact, kullan\u0131c\u0131 aray\u00fczleri olu\u015fturmak i\u00e7in pop\u00fcler bir JavaScript k\u00fct\u00fc","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_page_header_type":"","csco_page_load_nextpost":"","csco_page_subscribe_form":"","csco_page_contact_form":"","footnotes":""},"categories":[128],"tags":[],"class_list":{"0":"post-30639","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-react","7":"cs-entry","8":"cs-video-wrap"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.5 (Yoast SEO v25.3.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>React.PropTypes Kullanarak Tiplerle \u00c7al\u0131\u015fmak: Kapsaml\u0131 Bir Rehber - Kodlar\u0131n Gizemli D\u00fcnyas\u0131<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"React.PropTypes Kullanarak Tiplerle \u00c7al\u0131\u015fmak: Kapsaml\u0131 Bir Rehber\" \/>\n<meta property=\"og:description\" content=\"React.PropTypes Kullanarak Tiplerle \u00c7al\u0131\u015fmak: Kapsaml\u0131 Bir Rehber React, kullan\u0131c\u0131 aray\u00fczleri olu\u015fturmak i\u00e7in pop\u00fcler bir JavaScript k\u00fct\u00fc\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/\" \/>\n<meta property=\"og:site_name\" content=\"Kodlar\u0131n Gizemli D\u00fcnyas\u0131\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-30T01:41:09+00:00\" \/>\n<meta name=\"author\" content=\"Fatih Soysal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fatih Soysal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"25 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/\"},\"author\":{\"name\":\"Fatih Soysal\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"headline\":\"React.PropTypes Kullanarak Tiplerle \u00c7al\u0131\u015fmak: Kapsaml\u0131 Bir Rehber\",\"datePublished\":\"2025-09-30T01:41:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/\"},\"wordCount\":3976,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"articleSection\":[\"React\"],\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/#respond\"]}],\"copyrightYear\":\"2025\",\"copyrightHolder\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/\",\"name\":\"React.PropTypes Kullanarak Tiplerle \u00c7al\u0131\u015fmak: Kapsaml\u0131 Bir Rehber - Kodlar\u0131n Gizemli D\u00fcnyas\u0131\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\"},\"datePublished\":\"2025-09-30T01:41:09+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Anasayfa\",\"item\":\"https:\/\/fatihsoysal.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"React.PropTypes Kullanarak Tiplerle \u00c7al\u0131\u015fmak: Kapsaml\u0131 Bir Rehber\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/\",\"name\":\"Fatihsoysal.com\",\"description\":\"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim\",\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\",\"name\":\"Fatih Soysal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"contentUrl\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"width\":512,\"height\":512,\"caption\":\"Fatih Soysal\"},\"logo\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\"},\"description\":\"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"React.PropTypes Kullanarak Tiplerle \u00c7al\u0131\u015fmak: Kapsaml\u0131 Bir Rehber - Kodlar\u0131n Gizemli D\u00fcnyas\u0131","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/","og_locale":"tr_TR","og_type":"article","og_title":"React.PropTypes Kullanarak Tiplerle \u00c7al\u0131\u015fmak: Kapsaml\u0131 Bir Rehber","og_description":"React.PropTypes Kullanarak Tiplerle \u00c7al\u0131\u015fmak: Kapsaml\u0131 Bir Rehber React, kullan\u0131c\u0131 aray\u00fczleri olu\u015fturmak i\u00e7in pop\u00fcler bir JavaScript k\u00fct\u00fc","og_url":"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/","og_site_name":"Kodlar\u0131n Gizemli D\u00fcnyas\u0131","article_published_time":"2025-09-30T01:41:09+00:00","author":"Fatih Soysal","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"Fatih Soysal","Tahmini okuma s\u00fcresi":"25 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/#article","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/"},"author":{"name":"Fatih Soysal","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"headline":"React.PropTypes Kullanarak Tiplerle \u00c7al\u0131\u015fmak: Kapsaml\u0131 Bir Rehber","datePublished":"2025-09-30T01:41:09+00:00","mainEntityOfPage":{"@id":"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/"},"wordCount":3976,"commentCount":0,"publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"articleSection":["React"],"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/#respond"]}],"copyrightYear":"2025","copyrightHolder":{"@id":"https:\/\/fatihsoysal.com\/blog\/#organization"}},{"@type":"WebPage","@id":"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/","url":"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/","name":"React.PropTypes Kullanarak Tiplerle \u00c7al\u0131\u015fmak: Kapsaml\u0131 Bir Rehber - Kodlar\u0131n Gizemli D\u00fcnyas\u0131","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/#website"},"datePublished":"2025-09-30T01:41:09+00:00","breadcrumb":{"@id":"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/fatihsoysal.com\/blog\/react-proptypes-kullanarak-tiplerle-calismak-kapsamli-bir-rehber\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Anasayfa","item":"https:\/\/fatihsoysal.com\/blog\/"},{"@type":"ListItem","position":2,"name":"React.PropTypes Kullanarak Tiplerle \u00c7al\u0131\u015fmak: Kapsaml\u0131 Bir Rehber"}]},{"@type":"WebSite","@id":"https:\/\/fatihsoysal.com\/blog\/#website","url":"https:\/\/fatihsoysal.com\/blog\/","name":"Fatihsoysal.com","description":"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim","publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1","name":"Fatih Soysal","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","contentUrl":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","width":512,"height":512,"caption":"Fatih Soysal"},"logo":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/"},"description":"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.","url":"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/"}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/30639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/comments?post=30639"}],"version-history":[{"count":1,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/30639\/revisions"}],"predecessor-version":[{"id":30640,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/30639\/revisions\/30640"}],"wp:attachment":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/media?parent=30639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/categories?post=30639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/tags?post=30639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}