diff --git a/scripts/fiber/tests-failing.txt b/scripts/fiber/tests-failing.txt index 955d305f69..f91c436b8d 100644 --- a/scripts/fiber/tests-failing.txt +++ b/scripts/fiber/tests-failing.txt @@ -87,6 +87,9 @@ src/renderers/art/__tests__/ReactART-test.js * resolves refs before componentDidMount * resolves refs before componentDidUpdate +src/renderers/dom/__tests__/ReactDOMProduction-test.js +* should throw with an error code in production + src/renderers/dom/shared/__tests__/CSSPropertyOperations-test.js * should set style attribute when styles exist * should warn when using hyphenated style names diff --git a/scripts/fiber/tests-passing.txt b/scripts/fiber/tests-passing.txt index 42e9b95c1d..dbe78e0865 100644 --- a/scripts/fiber/tests-passing.txt +++ b/scripts/fiber/tests-passing.txt @@ -438,7 +438,6 @@ src/renderers/dom/__tests__/ReactDOMProduction-test.js * should use prod React * should handle a simple flow * should call lifecycle methods -* should throw with an error code in production src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js * should render strings as children diff --git a/src/renderers/shared/fiber/ReactFiberUpdateQueue.js b/src/renderers/shared/fiber/ReactFiberUpdateQueue.js index b1d985771c..c3c8cf7904 100644 --- a/src/renderers/shared/fiber/ReactFiberUpdateQueue.js +++ b/src/renderers/shared/fiber/ReactFiberUpdateQueue.js @@ -16,11 +16,11 @@ type UpdateQueueNode = { partialState: any, callback: ?Function, callbackWasCalled: boolean, + isReplace: boolean, next: ?UpdateQueueNode, }; export type UpdateQueue = UpdateQueueNode & { - isReplace: boolean, isForced: boolean, hasUpdate: boolean, hasCallback: boolean, @@ -32,8 +32,8 @@ exports.createUpdateQueue = function(partialState : mixed) : UpdateQueue { partialState, callback: null, callbackWasCalled: false, - next: null, isReplace: false, + next: null, isForced: false, hasUpdate: partialState != null, hasCallback: false, @@ -48,11 +48,12 @@ function addToQueue(queue : UpdateQueue, partialState : mixed) : UpdateQueue { partialState, callback: null, callbackWasCalled: false, + isReplace: false, next: null, }; queue.tail.next = node; queue.tail = node; - queue.hasUpdate = queue.hasUpdate || (partialState == null); + queue.hasUpdate = queue.hasUpdate || (partialState != null); return queue; } @@ -86,8 +87,9 @@ exports.callCallbacks = function(queue : UpdateQueue, context : any) { exports.mergeUpdateQueue = function(queue : UpdateQueue, instance : any, prevState : any, props : any) : any { let node : ?UpdateQueueNode = queue; - let state = queue.isReplace ? null : Object.assign({}, prevState); + let state = Object.assign({}, prevState); while (node) { + state = node.isReplace ? null : state; let partialState; if (typeof node.partialState === 'function') { const updateFn = node.partialState;