<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong></p>
<p dir="auto">bug</p>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">Setup:</p>
<ul dir="auto">
<li>A Component with a counter in it to track the number of renders.</li>
<li>A container Component with a counter in it</li>
<li>A container PureComponent with with a counter in it.</li>
</ul>
<p dir="auto"><em>All three of the above components accept children.</em></p>
<ul dir="auto">
<li>A main component that has a button in it that updates the state of some string value once</li>
</ul>
<p dir="auto">Scenario 1:</p>
<ul dir="auto">
<li>I use the regular container component with a single child: the string value state</li>
<li>I click the button multiple times</li>
<li>It updates each time as expected</li>
</ul>
<p dir="auto">Scenario 2:</p>
<ul dir="auto">
<li>I use the PureComponentContainer with a single child: a static string</li>
<li>I click the button multiple times</li>
<li>it has only renders 1 times (it's initial render) as expected</li>
</ul>
<p dir="auto">Scenario 3:</p>
<ul dir="auto">
<li>I use the PureComponentContainer with a single child: the string value state</li>
<li>I click the button multiple times</li>
<li>it has only renders 2 times (it's initial render, and updated render) as expected</li>
</ul>
<p dir="auto">Scenario 4:</p>
<ul dir="auto">
<li>I use the PureComponentContainer with a two children: the string value state, and a static value</li>
<li>I click the button multiple times</li>
<li>it updates each time I click, although the state value has changed only once. This is not expected</li>
</ul>
<p dir="auto">Here is an example where I implement each scenario as well as show a comparison using === and reacts shallowEquals</p>
<p dir="auto"><a href="https://codesandbox.io/s/w0vvkk92nl" rel="nofollow">https://codesandbox.io/s/w0vvkk92nl</a></p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (<a href="https://jsfiddle.net/Luktwrdm/" rel="nofollow">https://jsfiddle.net/Luktwrdm/</a>) or CodeSandbox (<a href="https://codesandbox.io/s/new" rel="nofollow">https://codesandbox.io/s/new</a>) example below:</strong></p>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">I may not fully understand the expected behavior of a PureComponent. I would assume due to the nature of how shallowEqual works it would validate as expected, whether or not the props has the same reference. In my example I show what happens when I compare two example props that both have the same values, but difference references. When I use normal === it doesn't validate if the ref is different, in shallowEqual is validates as long as the values are the same even if the refs are different.</p>
<p dir="auto">In my second example, the values are the same, and the reference to props doesn't change as expected<br>
In my third example, the values are again the same and the reference to the props again doesn't change as expected</p>
<p dir="auto">In my final example, the values are the same, but the reference changes.</p>
<p dir="auto">From this I am lead to believe it's not validating even before it gets to the shallowEqual check.</p>
<p dir="auto">Maybe my implementation is wrong?</p>
<p dir="auto"><strong>Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?</strong></p>
<p dir="auto">Google Chrome Version 70.0.3538.67 (Official Build) beta (64-bit)</p>
<p dir="auto">16.5.2, I also tested on 16.6.0 alpha.</p>
<p dir="auto">Mac OS 10.12.6</p>
<p dir="auto">I haven't verified on previous versions</p>
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br>
Bug</p>
<p dir="auto"><strong>What is the current behavior?</strong><br>
A specific order of unmounting and remounting <code class="notranslate">unstable_createReturn</code>s from <code class="notranslate">react-call-return</code> causes an invariant violation in <code class="notranslate">unmountHostComponents</code>.</p>
<p dir="auto"><strong>Reproduce</strong><br>
The following sandbox example crashes with an invariant violation when both the <code class="notranslate">min</code> and <code class="notranslate">cycle</code> props are <em>odd</em> numbers greater than zero.</p>
<p dir="auto"><a href="https://codesandbox.io/s/llyjz19rz7" rel="nofollow">https://codesandbox.io/s/llyjz19rz7</a></p>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
The app does not crash and cycles the number of items in the list.</p>
<p dir="auto"><strong>Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?</strong><br>
<code class="notranslate">react</code> and <code class="notranslate">react-dom</code> versions 16.1 and newer, <code class="notranslate">react-call-return</code> version 0.5.0</p>