Don't use owner to determine if the auto-bailout should be used

I didn't realize that we actually special cased this. This is an
unfortunate heuristic but it helps minimize the harm that this optimization
does.
This commit is contained in:
Sebastian Markbage
2015-08-18 17:33:13 -07:00
parent 5375b503e9
commit 9315517dec
2 changed files with 9 additions and 2 deletions
@@ -226,7 +226,14 @@ describe('ReactDOMSelect', function() {
// Changing the `value` prop should change the selected options.
objectToString.animal = 'monkey';
ReactDOM.render(el, container);
var el2 =
<select multiple={true} value={[objectToString]}>
<option value="monkey">A monkey!</option>
<option value="giraffe">A giraffe!</option>
<option value="gorilla">A gorilla!</option>
</select>;
ReactDOM.render(el2, container);
expect(node.options[0].selected).toBe(true); // monkey
expect(node.options[1].selected).toBe(false); // giraffe
@@ -65,8 +65,8 @@ var ReactReconciler = {
internalInstance, nextElement, transaction, context
) {
var prevElement = internalInstance._currentElement;
if (nextElement === prevElement &&
nextElement._owner != null &&
context === internalInstance._context
) {
// Since elements are immutable after the owner is rendered,