<h2 dir="auto">Feature request: Fill name attribute or add static toString() method for all PropTypes.</h2>
<p dir="auto">For example:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const StringPropType = PropTypes.string;
expect(StringPropType.name).toEqual('checkType: String');

const ArrayOfBoolType = PropTypes.arrayOf(PropTypes.bool);
expect(ArrayOfBoolType.name).toEqual('bound checkType: Array of Bool');

const ShapeType = PropTypes.shape({
  foo: PropTypes.bool,
  bar: PropTypes.number
});
expect(ShapeType.name).toEqual('bound checkType: Shape of foo:Bool, bar:Number'"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-v">StringPropType</span> <span class="pl-c1">=</span> <span class="pl-v">PropTypes</span><span class="pl-kos">.</span><span class="pl-c1">string</span><span class="pl-kos">;</span>
<span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-v">StringPropType</span><span class="pl-kos">.</span><span class="pl-c1">name</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toEqual</span><span class="pl-kos">(</span><span class="pl-s">'checkType: String'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-v">ArrayOfBoolType</span> <span class="pl-c1">=</span> <span class="pl-v">PropTypes</span><span class="pl-kos">.</span><span class="pl-en">arrayOf</span><span class="pl-kos">(</span><span class="pl-v">PropTypes</span><span class="pl-kos">.</span><span class="pl-c1">bool</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-v">ArrayOfBoolType</span><span class="pl-kos">.</span><span class="pl-c1">name</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toEqual</span><span class="pl-kos">(</span><span class="pl-s">'bound checkType: Array of Bool'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-v">ShapeType</span> <span class="pl-c1">=</span> <span class="pl-v">PropTypes</span><span class="pl-kos">.</span><span class="pl-en">shape</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
  <span class="pl-c1">foo</span>: <span class="pl-v">PropTypes</span><span class="pl-kos">.</span><span class="pl-c1">bool</span><span class="pl-kos">,</span>
  <span class="pl-c1">bar</span>: <span class="pl-v">PropTypes</span><span class="pl-kos">.</span><span class="pl-c1">number</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-v">ShapeType</span><span class="pl-kos">.</span><span class="pl-c1">name</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">toEqual</span><span class="pl-kos">(</span><span class="pl-s">'bound checkType: Shape of foo:Bool, bar:Number'</span></pre></div>
<p dir="auto">It maybe useful when debugging.<br>
In my case - I need to equal components prop types and throw exception if there are same props. So if generate names for prop types - they could be compared.</p>
<h3 dir="auto">Current behaviour</h3>
<p dir="auto">Only primitive types could be compared (string, bool, number).<br>
Complex types (shape, arrayOf) - each time returns new bound function. So it could not be compared by value.</p>
<h3 dir="auto">Problems with custom prop types</h3>
<p dir="auto">Will generate "undefined" name for custom prop like this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="customProp: function(props, propName, componentName) {
    if (!/matchme/.test(props[propName])) {
      return new Error(
        'Invalid prop `' + propName + '` supplied to' +
        ' `' + componentName + '`. Validation failed.'
      );
    }
  },"><pre class="notranslate"><span class="pl-s1">customProp</span>: <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">,</span> <span class="pl-s1">propName</span><span class="pl-kos">,</span> <span class="pl-s1">componentName</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-pds"><span class="pl-c1">/</span>matchme<span class="pl-c1">/</span></span><span class="pl-kos">.</span><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">[</span><span class="pl-s1">propName</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">Error</span><span class="pl-kos">(</span>
        <span class="pl-s">'Invalid prop `'</span> <span class="pl-c1">+</span> <span class="pl-s1">propName</span> <span class="pl-c1">+</span> <span class="pl-s">'` supplied to'</span> <span class="pl-c1">+</span>
        <span class="pl-s">' `'</span> <span class="pl-c1">+</span> <span class="pl-s1">componentName</span> <span class="pl-c1">+</span> <span class="pl-s">'`. Validation failed.'</span>
      <span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span></pre></div>
<p dir="auto">but it fixed by adding function name:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="customProp: function customProp(props, propName, componentName) {"><pre class="notranslate">customProp: <span class="pl-k">function</span> <span class="pl-en">customProp</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">,</span> <span class="pl-s1">propName</span><span class="pl-kos">,</span> <span class="pl-s1">componentName</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos"></span></pre></div>
<p dir="auto">btw. Same feature implemented at <a href="https://github.com/gcanti/tcomb">tcomb</a> lib</p>
<p dir="auto">Describe what you were doing when the bug occurred:<br>
I was using profiler to check the performance of my react app, and when i recorded one session, and clicked on close button, got this exception.</p>
<hr>
<h2 dir="auto">Please do not remove the text below this line</h2>
<p dir="auto">DevTools version: 4.12.2-d14b6a4bdd</p>
<p dir="auto">Call stack: at updateTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:20849:21)<br>
at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:20694:26)<br>
at ProfilingCache_ProfilingCache.getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:21268:11)<br>
at CommitFlamegraphAutoSizer (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:38408:33)<br>
at Rh (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:13414:7)<br>
at Ci (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:14115:7)<br>
at vk (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:16899:86)<br>
at uk (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:16419:11)<br>
at rk (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:16411:23)<br>
at jk (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:16395:5)</p>
<p dir="auto">Component stack: at CommitFlamegraphAutoSizer (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:38391:34)<br>
at div<br>
at div<br>
at div<br>
at SettingsModalContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:29445:3)<br>
at Profiler_Profiler (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40189:34)<br>
at ErrorBoundary_ErrorBoundary (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:33091:5)<br>
at PortaledContent (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:33171:5)<br>
at div<br>
at div<br>
at ProfilerContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:37210:3)<br>
at TreeContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:25673:3)<br>
at SettingsContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:26287:3)<br>
at ModalDialogContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:33314:3)<br>
at DevTools_DevTools (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40585:3)</p>