Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion scripts/fiber/tests-failing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ src/renderers/shared/shared/__tests__/ReactStatelessComponent-test.js
* should warn when using non-React functions in JSX

src/renderers/shared/shared/__tests__/ReactUpdates-test.js
* should queue mount-ready handlers across different roots
* marks top-level updates
* throws in setState if the update callback is not a function
* throws in replaceState if the update callback is not a function
Expand Down
1 change: 1 addition & 0 deletions scripts/fiber/tests-passing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,7 @@ src/renderers/shared/shared/__tests__/ReactUpdates-test.js
* should not reconcile children passed via props
* should flow updates correctly
* should share reconcile transaction across different roots
* should queue mount-ready handlers across different roots
* should flush updates in the correct order
* should flush updates in the correct order across roots
* should queue nested updates
Expand Down
16 changes: 14 additions & 2 deletions src/renderers/shared/shared/__tests__/ReactUpdates-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,8 @@ describe('ReactUpdates', () => {
// componentDidUpdate handlers is called, B's DOM should already have been
// updated.

var bContainer = document.createElement('div');

var a;
var b;

Expand All @@ -558,7 +560,15 @@ describe('ReactUpdates', () => {
}

render() {
return <div>A{this.state.x}</div>;
var portal = null;
// If we're using Fiber, we use Portals instead to achieve this.
if (ReactDOMFeatureFlags.useFiber) {
portal = ReactDOM.unstable_createPortal(
<B ref={n => b = n} />,
bContainer
);
}
return <div>A{this.state.x}{portal}</div>;
}
}

Expand All @@ -571,7 +581,9 @@ describe('ReactUpdates', () => {
}

a = ReactTestUtils.renderIntoDocument(<A />);
b = ReactTestUtils.renderIntoDocument(<B />);
if (!ReactDOMFeatureFlags.useFiber) {
ReactDOM.render(<B ref={n => b = n} />, bContainer);
}

ReactDOM.unstable_batchedUpdates(function() {
a.setState({x: 1});
Expand Down