<p dir="auto">Spun off from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="157049204" data-permission-text="Title is private" data-url="https://github.com/facebook/react/issues/6895" data-hovercard-type="issue" data-hovercard-url="/facebook/react/issues/6895/hovercard" href="https://github.com/facebook/react/issues/6895">#6895</a>, which was <a href="https://github.com/facebook/react/issues/6895#issuecomment-281405036" data-hovercard-type="issue" data-hovercard-url="/facebook/react/issues/6895/hovercard">closed with a request for reproducible test-cases to be filed as separate issues</a>.  The <a href="https://github.com/facebook/react/issues/6895#issuecomment-262750248" data-hovercard-type="issue" data-hovercard-url="/facebook/react/issues/6895/hovercard">test-case I'd filed there</a> (which failed on v15.4.1) is still failing on 15.4.2:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ node --version
v6.9.4
$ npm --version
3.10.10
$ git clone git://github.com/wking/performUpdateIfNecessary-bug.git bug
$ cd bug
$ npm install
$ npm install
performUpdateIfNecessary-bug@0.1.0 /tmp/bug
├─┬ react@15.4.2
│ ├─┬ fbjs@0.8.9
│ │ ├── core-js@1.2.7
│ │ ├─┬ isomorphic-fetch@2.2.1
│ │ │ ├─┬ node-fetch@1.6.3
│ │ │ │ ├─┬ encoding@0.1.12
│ │ │ │ │ └── iconv-lite@0.4.15
│ │ │ │ └── is-stream@1.1.0
│ │ │ └── whatwg-fetch@2.0.2
│ │ ├─┬ promise@7.1.1
│ │ │ └── asap@2.0.5
│ │ ├── setimmediate@1.0.5
│ │ └── ua-parser-js@0.7.12
│ ├─┬ loose-envify@1.3.1
│ │ └── js-tokens@3.0.1
│ └── object-assign@4.1.1
├── react-dom@15.4.2
└─┬ react-scripts@0.7.0
  …
$ npm test
…a…
…
  console.error node_modules/fbjs/lib/warning.js:36
    Warning: performUpdateIfNecessary: Unexpected batch number (current 2, pending 1)

 FAIL  src/Bug.test.js
  ● does not duplicate requests for loaded nodes

    duplicate call for 7
      
      at Bug.&lt;anonymous&gt; (src/Bug.js:16:17)
      at ReactCompositeComponentWrapper._processPendingState (node_modules/react-dom/lib/ReactCompositeComponent.js:675:66)
      at ReactCompositeComponentWrapper.updateComponent (node_modules/react-dom/lib/ReactCompositeComponent.js:618:26)
      at ReactCompositeComponentWrapper.performUpdateIfNecessary (node_modules/react-dom/lib/ReactCompositeComponent.js:561:12)
      at Object.performUpdateIfNecessary (node_modules/react-dom/lib/ReactReconciler.js:157:22)
      at runBatchedUpdates (node_modules/react-dom/lib/ReactUpdates.js:150:21)
      at ReactReconcileTransaction.perform (node_modules/react-dom/lib/Transaction.js:140:20)
      at ReactUpdatesFlushTransaction.perform (node_modules/react-dom/lib/Transaction.js:140:20)
      at ReactUpdatesFlushTransaction.perform (node_modules/react-dom/lib/ReactUpdates.js:89:32)
      at Object.flushBatchedUpdates (node_modules/react-dom/lib/ReactUpdates.js:172:19)
      at ReactDefaultBatchingStrategyTransaction.closeAll (node_modules/react-dom/lib/Transaction.js:206:25)
      at ReactDefaultBatchingStrategyTransaction.perform (node_modules/react-dom/lib/Transaction.js:153:16)
      at Object.batchedUpdates (node_modules/react-dom/lib/ReactDefaultBatchingStrategy.js:62:26)
      at Object.batchedUpdates (node_modules/react-dom/lib/ReactUpdates.js:97:27)
      at Object._renderNewRootComponent (node_modules/react-dom/lib/ReactMount.js:320:18)
      at Object._renderSubtreeIntoContainer (node_modules/react-dom/lib/ReactMount.js:401:32)
      at Object.render (node_modules/react-dom/lib/ReactMount.js:422:23)
      at Object.&lt;anonymous&gt;.it (src/Bug.test.js:7:48)

  ✕ does not duplicate requests for loaded nodes (3ms)
…"><pre class="notranslate"><code class="notranslate">$ node --version
v6.9.4
$ npm --version
3.10.10
$ git clone git://github.com/wking/performUpdateIfNecessary-bug.git bug
$ cd bug
$ npm install
$ npm install
performUpdateIfNecessary-bug@0.1.0 /tmp/bug
├─┬ react@15.4.2
│ ├─┬ fbjs@0.8.9
│ │ ├── core-js@1.2.7
│ │ ├─┬ isomorphic-fetch@2.2.1
│ │ │ ├─┬ node-fetch@1.6.3
│ │ │ │ ├─┬ encoding@0.1.12
│ │ │ │ │ └── iconv-lite@0.4.15
│ │ │ │ └── is-stream@1.1.0
│ │ │ └── whatwg-fetch@2.0.2
│ │ ├─┬ promise@7.1.1
│ │ │ └── asap@2.0.5
│ │ ├── setimmediate@1.0.5
│ │ └── ua-parser-js@0.7.12
│ ├─┬ loose-envify@1.3.1
│ │ └── js-tokens@3.0.1
│ └── object-assign@4.1.1
├── react-dom@15.4.2
└─┬ react-scripts@0.7.0
  …
$ npm test
…a…
…
  console.error node_modules/fbjs/lib/warning.js:36
    Warning: performUpdateIfNecessary: Unexpected batch number (current 2, pending 1)

 FAIL  src/Bug.test.js
  ● does not duplicate requests for loaded nodes

    duplicate call for 7
      
      at Bug.&lt;anonymous&gt; (src/Bug.js:16:17)
      at ReactCompositeComponentWrapper._processPendingState (node_modules/react-dom/lib/ReactCompositeComponent.js:675:66)
      at ReactCompositeComponentWrapper.updateComponent (node_modules/react-dom/lib/ReactCompositeComponent.js:618:26)
      at ReactCompositeComponentWrapper.performUpdateIfNecessary (node_modules/react-dom/lib/ReactCompositeComponent.js:561:12)
      at Object.performUpdateIfNecessary (node_modules/react-dom/lib/ReactReconciler.js:157:22)
      at runBatchedUpdates (node_modules/react-dom/lib/ReactUpdates.js:150:21)
      at ReactReconcileTransaction.perform (node_modules/react-dom/lib/Transaction.js:140:20)
      at ReactUpdatesFlushTransaction.perform (node_modules/react-dom/lib/Transaction.js:140:20)
      at ReactUpdatesFlushTransaction.perform (node_modules/react-dom/lib/ReactUpdates.js:89:32)
      at Object.flushBatchedUpdates (node_modules/react-dom/lib/ReactUpdates.js:172:19)
      at ReactDefaultBatchingStrategyTransaction.closeAll (node_modules/react-dom/lib/Transaction.js:206:25)
      at ReactDefaultBatchingStrategyTransaction.perform (node_modules/react-dom/lib/Transaction.js:153:16)
      at Object.batchedUpdates (node_modules/react-dom/lib/ReactDefaultBatchingStrategy.js:62:26)
      at Object.batchedUpdates (node_modules/react-dom/lib/ReactUpdates.js:97:27)
      at Object._renderNewRootComponent (node_modules/react-dom/lib/ReactMount.js:320:18)
      at Object._renderSubtreeIntoContainer (node_modules/react-dom/lib/ReactMount.js:401:32)
      at Object.render (node_modules/react-dom/lib/ReactMount.js:422:23)
      at Object.&lt;anonymous&gt;.it (src/Bug.test.js:7:48)

  ✕ does not duplicate requests for loaded nodes (3ms)
…
</code></pre></div>
<p dir="auto">There are no <a href="https://github.com/facebook/react/issues/7617#issuecomment-247710003" data-hovercard-type="issue" data-hovercard-url="/facebook/react/issues/7617/hovercard">local <code class="notranslate">catch</code> calls</a> in my code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ git grep catch
…no hits…"><pre class="notranslate"><code class="notranslate">$ git grep catch
…no hits…
</code></pre></div>
<p dir="auto">And really, there's not much code in the example at all :p.  There may be bugs and catches deeper in the stack, but the only direct dependencies are <code class="notranslate">react-scripts</code>, <code class="notranslate">react</code>, and <code class="notranslate">react-dom</code>, so it seems like an issue in a Facebook-maintained repository (or possibly one of their dependencies, in which case a Facebook-maintained dependency may need to be bumped).</p>
<p dir="auto">I would like to propose a feature to be implemented in react based on this library <a href="https://github.com/myckhel/react-use-component">https://github.com/myckhel/react-use-component</a></p>
<p dir="auto">The <code class="notranslate">react-use-component</code> was created to limit the use of memoised callback hooks and to create <code class="notranslate">Object Oriented</code> functional <code class="notranslate">Components</code>.</p>
<p dir="auto">I would like the react team to look into the concept of this <code class="notranslate">API</code> and consider its benefits to the amazing <code class="notranslate">React</code> framework.</p>
<p dir="auto">Thanks for your review.</p>