mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user