@@ -192,10 +192,10 @@ describe('ReactIncremental', () => {
inst.setState(
() => {
- ReactNoop.yield('setState1');
+ Scheduler.yieldValue('setState1');
return {text: 'bar'};
},
- () => ReactNoop.yield('callback1'),
+ () => Scheduler.yieldValue('callback1'),
);
// Flush part of the work
@@ -205,10 +205,10 @@ describe('ReactIncremental', () => {
ReactNoop.flushSync(() => ReactNoop.render(
));
inst.setState(
() => {
- ReactNoop.yield('setState2');
+ Scheduler.yieldValue('setState2');
return {text2: 'baz'};
},
- () => ReactNoop.yield('callback2'),
+ () => Scheduler.yieldValue('callback2'),
);
// Flush the rest of the work which now includes the low priority
@@ -223,17 +223,17 @@ describe('ReactIncremental', () => {
it('can deprioritize unfinished work and resume it later', () => {
function Bar(props) {
- ReactNoop.yield('Bar');
+ Scheduler.yieldValue('Bar');
return
;
}
function Middle(props) {
- ReactNoop.yield('Middle');
+ Scheduler.yieldValue('Middle');
return
;
}
function Foo(props) {
- ReactNoop.yield('Foo');
+ Scheduler.yieldValue('Foo');
return (
{props.text}
@@ -1086,7 +1086,7 @@ describe('ReactIncremental', () => {
class Foo extends React.PureComponent {
render() {
const msg = `A: ${a}, B: ${this.props.b}`;
- ReactNoop.yield(msg);
+ Scheduler.yieldValue(msg);
return msg;
}
}
@@ -1456,18 +1456,18 @@ describe('ReactIncremental', () => {
class Parent extends React.Component {
state = {parentRenders: 0};
static getDerivedStateFromProps(props, prevState) {
- ReactNoop.yield('getDerivedStateFromProps');
+ Scheduler.yieldValue('getDerivedStateFromProps');
return prevState.parentRenders + 1;
}
render() {
- ReactNoop.yield('Parent');
+ Scheduler.yieldValue('Parent');
return
;
}
}
class Child extends React.Component {
render() {
- ReactNoop.yield('Child');
+ Scheduler.yieldValue('Child');
return this.props.parentRenders;
}
}
@@ -1819,7 +1819,7 @@ describe('ReactIncremental', () => {
};
}
render() {
- ReactNoop.yield('Intl ' + JSON.stringify(this.context));
+ Scheduler.yieldValue('Intl ' + JSON.stringify(this.context));
return this.props.children;
}
}
@@ -1834,7 +1834,7 @@ describe('ReactIncremental', () => {
};
}
render() {
- ReactNoop.yield('Router ' + JSON.stringify(this.context));
+ Scheduler.yieldValue('Router ' + JSON.stringify(this.context));
return this.props.children;
}
}
@@ -1844,7 +1844,7 @@ describe('ReactIncremental', () => {
locale: PropTypes.string,
};
render() {
- ReactNoop.yield('ShowLocale ' + JSON.stringify(this.context));
+ Scheduler.yieldValue('ShowLocale ' + JSON.stringify(this.context));
return this.context.locale;
}
}
@@ -1854,13 +1854,13 @@ describe('ReactIncremental', () => {
route: PropTypes.string,
};
render() {
- ReactNoop.yield('ShowRoute ' + JSON.stringify(this.context));
+ Scheduler.yieldValue('ShowRoute ' + JSON.stringify(this.context));
return this.context.route;
}
}
function ShowBoth(props, context) {
- ReactNoop.yield('ShowBoth ' + JSON.stringify(context));
+ Scheduler.yieldValue('ShowBoth ' + JSON.stringify(context));
return `${context.route} in ${context.locale}`;
}
ShowBoth.contextTypes = {
@@ -1870,14 +1870,14 @@ describe('ReactIncremental', () => {
class ShowNeither extends React.Component {
render() {
- ReactNoop.yield('ShowNeither ' + JSON.stringify(this.context));
+ Scheduler.yieldValue('ShowNeither ' + JSON.stringify(this.context));
return null;
}
}
class Indirection extends React.Component {
render() {
- ReactNoop.yield('Indirection ' + JSON.stringify(this.context));
+ Scheduler.yieldValue('Indirection ' + JSON.stringify(this.context));
return [
,
,
@@ -2049,7 +2049,7 @@ describe('ReactIncremental', () => {
};
}
render() {
- ReactNoop.yield('Intl ' + JSON.stringify(this.context));
+ Scheduler.yieldValue('Intl ' + JSON.stringify(this.context));
return this.props.children;
}
}
@@ -2059,7 +2059,7 @@ describe('ReactIncremental', () => {
locale: PropTypes.string,
};
render() {
- ReactNoop.yield('ShowLocale ' + JSON.stringify(this.context));
+ Scheduler.yieldValue('ShowLocale ' + JSON.stringify(this.context));
return this.context.locale;
}
}
@@ -2810,12 +2810,12 @@ describe('ReactIncremental', () => {
it('does not interrupt for update at same priority', () => {
function Parent(props) {
- ReactNoop.yield('Parent: ' + props.step);
+ Scheduler.yieldValue('Parent: ' + props.step);
return
;
}
function Child(props) {
- ReactNoop.yield('Child: ' + props.step);
+ Scheduler.yieldValue('Child: ' + props.step);
return null;
}
@@ -2830,12 +2830,12 @@ describe('ReactIncremental', () => {
it('does not interrupt for update at lower priority', () => {
function Parent(props) {
- ReactNoop.yield('Parent: ' + props.step);
+ Scheduler.yieldValue('Parent: ' + props.step);
return
;
}
function Child(props) {
- ReactNoop.yield('Child: ' + props.step);
+ Scheduler.yieldValue('Child: ' + props.step);
return null;
}
@@ -2851,12 +2851,12 @@ describe('ReactIncremental', () => {
it('does interrupt for update at higher priority', () => {
function Parent(props) {
- ReactNoop.yield('Parent: ' + props.step);
+ Scheduler.yieldValue('Parent: ' + props.step);
return
;
}
function Child(props) {
- ReactNoop.yield('Child: ' + props.step);
+ Scheduler.yieldValue('Child: ' + props.step);
return null;
}
diff --git a/packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.internal.js b/packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.internal.js
index 9f009a6f10090..6979375d5a003 100644
--- a/packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.internal.js
+++ b/packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.internal.js
@@ -45,31 +45,31 @@ describe('ReactIncrementalErrorHandling', () => {
class ErrorBoundary extends React.Component {
state = {error: null};
static getDerivedStateFromError(error) {
- ReactNoop.yield('getDerivedStateFromError');
+ Scheduler.yieldValue('getDerivedStateFromError');
return {error};
}
render() {
if (this.state.error) {
- ReactNoop.yield('ErrorBoundary (catch)');
+ Scheduler.yieldValue('ErrorBoundary (catch)');
return
;
}
- ReactNoop.yield('ErrorBoundary (try)');
+ Scheduler.yieldValue('ErrorBoundary (try)');
return this.props.children;
}
}
function ErrorMessage(props) {
- ReactNoop.yield('ErrorMessage');
+ Scheduler.yieldValue('ErrorMessage');
return
;
}
function Indirection(props) {
- ReactNoop.yield('Indirection');
+ Scheduler.yieldValue('Indirection');
return props.children || null;
}
function BadRender() {
- ReactNoop.yield('throw');
+ Scheduler.yieldValue('throw');
throw new Error('oops!');
}
@@ -138,31 +138,31 @@ describe('ReactIncrementalErrorHandling', () => {
class ErrorBoundary extends React.Component {
state = {error: null};
componentDidCatch(error) {
- ReactNoop.yield('componentDidCatch');
+ Scheduler.yieldValue('componentDidCatch');
this.setState({error});
}
render() {
if (this.state.error) {
- ReactNoop.yield('ErrorBoundary (catch)');
+ Scheduler.yieldValue('ErrorBoundary (catch)');
return
;
}
- ReactNoop.yield('ErrorBoundary (try)');
+ Scheduler.yieldValue('ErrorBoundary (try)');
return this.props.children;
}
}
function ErrorMessage(props) {
- ReactNoop.yield('ErrorMessage');
+ Scheduler.yieldValue('ErrorMessage');
return
;
}
function Indirection(props) {
- ReactNoop.yield('Indirection');
+ Scheduler.yieldValue('Indirection');
return props.children || null;
}
function BadRender() {
- ReactNoop.yield('throw');
+ Scheduler.yieldValue('throw');
throw new Error('oops!');
}
@@ -217,15 +217,15 @@ describe('ReactIncrementalErrorHandling', () => {
it("retries at a lower priority if there's additional pending work", () => {
function App(props) {
if (props.isBroken) {
- ReactNoop.yield('error');
+ Scheduler.yieldValue('error');
throw new Error('Oops!');
}
- ReactNoop.yield('success');
+ Scheduler.yieldValue('success');
return
;
}
function onCommit() {
- ReactNoop.yield('commit');
+ Scheduler.yieldValue('commit');
}
function interrupt() {
@@ -259,11 +259,11 @@ describe('ReactIncrementalErrorHandling', () => {
class Parent extends React.Component {
state = {hideChild: false};
componentDidUpdate() {
- ReactNoop.yield('commit: ' + this.state.hideChild);
+ Scheduler.yieldValue('commit: ' + this.state.hideChild);
}
render() {
if (this.state.hideChild) {
- ReactNoop.yield('(empty)');
+ Scheduler.yieldValue('(empty)');
return
;
}
return
;
@@ -272,10 +272,10 @@ describe('ReactIncrementalErrorHandling', () => {
function Child(props) {
if (props.isBroken) {
- ReactNoop.yield('Error!');
+ Scheduler.yieldValue('Error!');
throw new Error('Error!');
}
- ReactNoop.yield('Child');
+ Scheduler.yieldValue('Child');
return
;
}
@@ -309,19 +309,19 @@ describe('ReactIncrementalErrorHandling', () => {
let ops = [];
function BadRender() {
ops.push('BadRender');
- ReactNoop.yield('BadRender');
+ Scheduler.yieldValue('BadRender');
throw new Error('oops');
}
function Sibling() {
ops.push('Sibling');
- ReactNoop.yield('Sibling');
+ Scheduler.yieldValue('Sibling');
return
;
}
function Parent() {
ops.push('Parent');
- ReactNoop.yield('Parent');
+ Scheduler.yieldValue('Parent');
return (
@@ -330,7 +330,7 @@ describe('ReactIncrementalErrorHandling', () => {
);
}
- ReactNoop.render(, () => ReactNoop.yield('commit'));
+ ReactNoop.render(, () => Scheduler.yieldValue('commit'));
// Render the bad component asynchronously
expect(Scheduler).toFlushAndYieldThrough(['Parent', 'BadRender']);
@@ -355,7 +355,7 @@ describe('ReactIncrementalErrorHandling', () => {
throw new Error(`Error ${++id}`);
}
render() {
- ReactNoop.yield('BadMount');
+ Scheduler.yieldValue('BadMount');
return null;
}
}
@@ -363,14 +363,14 @@ describe('ReactIncrementalErrorHandling', () => {
class ErrorBoundary extends React.Component {
state = {errorCount: 0};
componentDidCatch(error) {
- ReactNoop.yield(`componentDidCatch: ${error.message}`);
+ Scheduler.yieldValue(`componentDidCatch: ${error.message}`);
this.setState(state => ({errorCount: state.errorCount + 1}));
}
render() {
if (this.state.errorCount > 0) {
return ;
}
- ReactNoop.yield('ErrorBoundary');
+ Scheduler.yieldValue('ErrorBoundary');
return this.props.children;
}
}
@@ -428,23 +428,23 @@ describe('ReactIncrementalErrorHandling', () => {
class ErrorBoundary extends React.Component {
state = {error: null};
componentDidCatch(error) {
- ReactNoop.yield('ErrorBoundary componentDidCatch');
+ Scheduler.yieldValue('ErrorBoundary componentDidCatch');
this.setState({error});
}
render() {
if (this.state.error) {
- ReactNoop.yield('ErrorBoundary render error');
+ Scheduler.yieldValue('ErrorBoundary render error');
return (
);
}
- ReactNoop.yield('ErrorBoundary render success');
+ Scheduler.yieldValue('ErrorBoundary render success');
return this.props.children;
}
}
function BrokenRender(props) {
- ReactNoop.yield('BrokenRender');
+ Scheduler.yieldValue('BrokenRender');
throw new Error('Hello');
}
@@ -601,17 +601,17 @@ describe('ReactIncrementalErrorHandling', () => {
it('propagates an error from a noop error boundary during partial deferred mounting', () => {
class RethrowErrorBoundary extends React.Component {
componentDidCatch(error) {
- ReactNoop.yield('RethrowErrorBoundary componentDidCatch');
+ Scheduler.yieldValue('RethrowErrorBoundary componentDidCatch');
throw error;
}
render() {
- ReactNoop.yield('RethrowErrorBoundary render');
+ Scheduler.yieldValue('RethrowErrorBoundary render');
return this.props.children;
}
}
function BrokenRender() {
- ReactNoop.yield('BrokenRender');
+ Scheduler.yieldValue('BrokenRender');
throw new Error('Hello');
}
@@ -858,7 +858,7 @@ describe('ReactIncrementalErrorHandling', () => {
it('should not attempt to recover an unmounting error boundary', () => {
class Parent extends React.Component {
componentWillUnmount() {
- ReactNoop.yield('Parent componentWillUnmount');
+ Scheduler.yieldValue('Parent componentWillUnmount');
}
render() {
return ;
@@ -867,7 +867,7 @@ describe('ReactIncrementalErrorHandling', () => {
class Boundary extends React.Component {
componentDidCatch(e) {
- ReactNoop.yield(`Caught error: ${e.message}`);
+ Scheduler.yieldValue(`Caught error: ${e.message}`);
}
render() {
return ;
@@ -876,7 +876,7 @@ describe('ReactIncrementalErrorHandling', () => {
class ThrowsOnUnmount extends React.Component {
componentWillUnmount() {
- ReactNoop.yield('ThrowsOnUnmount componentWillUnmount');
+ Scheduler.yieldValue('ThrowsOnUnmount componentWillUnmount');
throw new Error('unmount error');
}
render() {
@@ -1406,31 +1406,31 @@ describe('ReactIncrementalErrorHandling', () => {
class ErrorBoundary extends React.Component {
state = {error: null};
componentDidCatch(error) {
- ReactNoop.yield('componentDidCatch');
+ Scheduler.yieldValue('componentDidCatch');
this.setState({error});
}
render() {
if (this.state.error) {
- ReactNoop.yield('ErrorBoundary (catch)');
+ Scheduler.yieldValue('ErrorBoundary (catch)');
return ;
}
- ReactNoop.yield('ErrorBoundary (try)');
+ Scheduler.yieldValue('ErrorBoundary (try)');
return this.props.children;
}
}
function ErrorMessage(props) {
- ReactNoop.yield('ErrorMessage');
+ Scheduler.yieldValue('ErrorMessage');
return ;
}
function BadRenderSibling(props) {
- ReactNoop.yield('BadRenderSibling');
+ Scheduler.yieldValue('BadRenderSibling');
return null;
}
function BadRender() {
- ReactNoop.yield('throw');
+ Scheduler.yieldValue('throw');
throw new Error('oops!');
}
@@ -1468,25 +1468,25 @@ describe('ReactIncrementalErrorHandling', () => {
// where we checked for the existence of didUpdate instead of didMount, and
// didMount was not defined.
function BadRender() {
- ReactNoop.yield('throw');
+ Scheduler.yieldValue('throw');
throw new Error('oops!');
}
class Parent extends React.Component {
state = {error: null, other: false};
componentDidCatch(error) {
- ReactNoop.yield('did catch');
+ Scheduler.yieldValue('did catch');
this.setState({error});
}
componentDidUpdate() {
- ReactNoop.yield('did update');
+ Scheduler.yieldValue('did update');
}
render() {
if (this.state.error) {
- ReactNoop.yield('render error message');
+ Scheduler.yieldValue('render error message');
return ;
}
- ReactNoop.yield('render');
+ Scheduler.yieldValue('render');
return ;
}
}
@@ -1512,7 +1512,7 @@ describe('ReactIncrementalErrorHandling', () => {
}
render() {
if (this.state.errorInfo) {
- ReactNoop.yield('render error message');
+ Scheduler.yieldValue('render error message');
return (
{
this.setState({step: 1});
}
componentWillUnmount() {
- ReactNoop.yield('componentWillUnmount: ' + this.state.step);
+ Scheduler.yieldValue('componentWillUnmount: ' + this.state.step);
}
render() {
- ReactNoop.yield('render: ' + this.state.step);
+ Scheduler.yieldValue('render: ' + this.state.step);
if (this.state.step > 0) {
throw new Error('oops');
}
diff --git a/packages/react-reconciler/src/__tests__/ReactIncrementalPerf-test.internal.js b/packages/react-reconciler/src/__tests__/ReactIncrementalPerf-test.internal.js
index 8e69483b6a384..a854ec7869d2d 100644
--- a/packages/react-reconciler/src/__tests__/ReactIncrementalPerf-test.internal.js
+++ b/packages/react-reconciler/src/__tests__/ReactIncrementalPerf-test.internal.js
@@ -399,21 +399,21 @@ describe('ReactDebugFiberPerf', () => {
it('measures deferred work in chunks', () => {
class A extends React.Component {
render() {
- ReactNoop.yield('A');
+ Scheduler.yieldValue('A');
return {this.props.children}
;
}
}
class B extends React.Component {
render() {
- ReactNoop.yield('B');
+ Scheduler.yieldValue('B');
return {this.props.children}
;
}
}
class C extends React.Component {
render() {
- ReactNoop.yield('C');
+ Scheduler.yieldValue('C');
return {this.props.children}
;
}
}
@@ -644,7 +644,7 @@ describe('ReactDebugFiberPerf', () => {
it('warns if an in-progress update is interrupted', () => {
function Foo() {
- ReactNoop.yield('Foo');
+ Scheduler.yieldValue('Foo');
return ;
}
diff --git a/packages/react-reconciler/src/__tests__/ReactIncrementalReflection-test.internal.js b/packages/react-reconciler/src/__tests__/ReactIncrementalReflection-test.internal.js
index 771efbdd4837e..f37578b314ba4 100644
--- a/packages/react-reconciler/src/__tests__/ReactIncrementalReflection-test.internal.js
+++ b/packages/react-reconciler/src/__tests__/ReactIncrementalReflection-test.internal.js
@@ -47,10 +47,10 @@ describe('ReactIncrementalReflection', () => {
}
UNSAFE_componentWillMount() {
instances.push(this);
- ReactNoop.yield('componentWillMount: ' + this._isMounted());
+ Scheduler.yieldValue('componentWillMount: ' + this._isMounted());
}
componentDidMount() {
- ReactNoop.yield('componentDidMount: ' + this._isMounted());
+ Scheduler.yieldValue('componentDidMount: ' + this._isMounted());
}
render() {
return ;
@@ -91,16 +91,16 @@ describe('ReactIncrementalReflection', () => {
instances.push(this);
}
componentWillUnmount() {
- ReactNoop.yield('componentWillUnmount: ' + this._isMounted());
+ Scheduler.yieldValue('componentWillUnmount: ' + this._isMounted());
}
render() {
- ReactNoop.yield('Component');
+ Scheduler.yieldValue('Component');
return ;
}
}
function Other() {
- ReactNoop.yield('Other');
+ Scheduler.yieldValue('Other');
return ;
}
@@ -149,22 +149,22 @@ describe('ReactIncrementalReflection', () => {
class Component extends React.Component {
UNSAFE_componentWillMount() {
classInstance = this;
- ReactNoop.yield(['componentWillMount', findInstance(this)]);
+ Scheduler.yieldValue(['componentWillMount', findInstance(this)]);
}
componentDidMount() {
- ReactNoop.yield(['componentDidMount', findInstance(this)]);
+ Scheduler.yieldValue(['componentDidMount', findInstance(this)]);
}
UNSAFE_componentWillUpdate() {
- ReactNoop.yield(['componentWillUpdate', findInstance(this)]);
+ Scheduler.yieldValue(['componentWillUpdate', findInstance(this)]);
}
componentDidUpdate() {
- ReactNoop.yield(['componentDidUpdate', findInstance(this)]);
+ Scheduler.yieldValue(['componentDidUpdate', findInstance(this)]);
}
componentWillUnmount() {
- ReactNoop.yield(['componentWillUnmount', findInstance(this)]);
+ Scheduler.yieldValue(['componentWillUnmount', findInstance(this)]);
}
render() {
- ReactNoop.yield('render');
+ Scheduler.yieldValue('render');
return this.props.step < 2 ? (
(this.span = ref)} />
) : this.props.step === 2 ? (
@@ -177,7 +177,7 @@ describe('ReactIncrementalReflection', () => {
function Sibling() {
// Sibling is used to assert that we've rendered past the first component.
- ReactNoop.yield('render sibling');
+ Scheduler.yieldValue('render sibling');
return ;
}
diff --git a/packages/react-reconciler/src/__tests__/ReactIncrementalScheduling-test.internal.js b/packages/react-reconciler/src/__tests__/ReactIncrementalScheduling-test.internal.js
index 4ee25bc545ed1..76158a89fe68b 100644
--- a/packages/react-reconciler/src/__tests__/ReactIncrementalScheduling-test.internal.js
+++ b/packages/react-reconciler/src/__tests__/ReactIncrementalScheduling-test.internal.js
@@ -92,7 +92,7 @@ describe('ReactIncrementalScheduling', () => {
function Text({text}) {
useEffect(
() => {
- ReactNoop.yield(text);
+ Scheduler.yieldValue(text);
},
[text],
);
@@ -144,24 +144,24 @@ describe('ReactIncrementalScheduling', () => {
state = {tick: 0};
componentDidMount() {
- ReactNoop.yield(
+ Scheduler.yieldValue(
'componentDidMount (before setState): ' + this.state.tick,
);
this.setState({tick: 1});
// We're in a batch. Update hasn't flushed yet.
- ReactNoop.yield(
+ Scheduler.yieldValue(
'componentDidMount (after setState): ' + this.state.tick,
);
}
componentDidUpdate() {
- ReactNoop.yield('componentDidUpdate: ' + this.state.tick);
+ Scheduler.yieldValue('componentDidUpdate: ' + this.state.tick);
if (this.state.tick === 2) {
- ReactNoop.yield(
+ Scheduler.yieldValue(
'componentDidUpdate (before setState): ' + this.state.tick,
);
this.setState({tick: 3});
- ReactNoop.yield(
+ Scheduler.yieldValue(
'componentDidUpdate (after setState): ' + this.state.tick,
);
// We're in a batch. Update hasn't flushed yet.
@@ -169,7 +169,7 @@ describe('ReactIncrementalScheduling', () => {
}
render() {
- ReactNoop.yield('render: ' + this.state.tick);
+ Scheduler.yieldValue('render: ' + this.state.tick);
instance = this;
return ;
}
@@ -209,11 +209,11 @@ describe('ReactIncrementalScheduling', () => {
componentDidMount() {
ReactNoop.deferredUpdates(() => {
- ReactNoop.yield(
+ Scheduler.yieldValue(
'componentDidMount (before setState): ' + this.state.tick,
);
this.setState({tick: 1});
- ReactNoop.yield(
+ Scheduler.yieldValue(
'componentDidMount (after setState): ' + this.state.tick,
);
});
@@ -221,13 +221,13 @@ describe('ReactIncrementalScheduling', () => {
componentDidUpdate() {
ReactNoop.deferredUpdates(() => {
- ReactNoop.yield('componentDidUpdate: ' + this.state.tick);
+ Scheduler.yieldValue('componentDidUpdate: ' + this.state.tick);
if (this.state.tick === 2) {
- ReactNoop.yield(
+ Scheduler.yieldValue(
'componentDidUpdate (before setState): ' + this.state.tick,
);
this.setState({tick: 3});
- ReactNoop.yield(
+ Scheduler.yieldValue(
'componentDidUpdate (after setState): ' + this.state.tick,
);
}
@@ -235,7 +235,7 @@ describe('ReactIncrementalScheduling', () => {
}
render() {
- ReactNoop.yield('render: ' + this.state.tick);
+ Scheduler.yieldValue('render: ' + this.state.tick);
instance = this;
return ;
}
@@ -285,7 +285,7 @@ describe('ReactIncrementalScheduling', () => {
});
}
render() {
- ReactNoop.yield('Foo');
+ Scheduler.yieldValue('Foo');
return ;
}
}
diff --git a/packages/react-reconciler/src/__tests__/ReactIncrementalSideEffects-test.internal.js b/packages/react-reconciler/src/__tests__/ReactIncrementalSideEffects-test.internal.js
index c5c4afeb78d4c..5d10f94eec81f 100644
--- a/packages/react-reconciler/src/__tests__/ReactIncrementalSideEffects-test.internal.js
+++ b/packages/react-reconciler/src/__tests__/ReactIncrementalSideEffects-test.internal.js
@@ -375,12 +375,12 @@ describe('ReactIncrementalSideEffects', () => {
it('does not update child nodes if a flush is aborted', () => {
function Bar(props) {
- ReactNoop.yield('Bar');
+ Scheduler.yieldValue('Bar');
return ;
}
function Foo(props) {
- ReactNoop.yield('Foo');
+ Scheduler.yieldValue('Foo');
return (
@@ -409,12 +409,12 @@ describe('ReactIncrementalSideEffects', () => {
it('preserves a previously rendered node when deprioritized', () => {
function Middle(props) {
- ReactNoop.yield('Middle');
+ Scheduler.yieldValue('Middle');
return
;
}
function Foo(props) {
- ReactNoop.yield('Foo');
+ Scheduler.yieldValue('Foo');
return (
@@ -435,7 +435,7 @@ describe('ReactIncrementalSideEffects', () => {
,
);
- ReactNoop.render(
, () => ReactNoop.yield('commit'));
+ ReactNoop.render(
, () => Scheduler.yieldValue('commit'));
expect(Scheduler).toFlushAndYieldThrough(['Foo', 'commit']);
expect(ReactNoop.getChildrenAsJSX()).toEqual(
@@ -457,7 +457,7 @@ describe('ReactIncrementalSideEffects', () => {
it('can reuse side-effects after being preempted', () => {
function Bar(props) {
- ReactNoop.yield('Bar');
+ Scheduler.yieldValue('Bar');
return
;
}
@@ -469,7 +469,7 @@ describe('ReactIncrementalSideEffects', () => {
);
function Foo(props) {
- ReactNoop.yield('Foo');
+ Scheduler.yieldValue('Foo');
return (
{props.step === 0 ? (
@@ -500,7 +500,7 @@ describe('ReactIncrementalSideEffects', () => {
// Make a quick update which will schedule low priority work to
// update the middle content.
ReactNoop.render(
, () =>
- ReactNoop.yield('commit'),
+ Scheduler.yieldValue('commit'),
);
expect(Scheduler).toFlushAndYieldThrough(['Foo', 'commit', 'Bar']);
@@ -540,7 +540,7 @@ describe('ReactIncrementalSideEffects', () => {
return this.props.children !== nextProps.children;
}
render() {
- ReactNoop.yield('Bar');
+ Scheduler.yieldValue('Bar');
return
;
}
}
@@ -550,7 +550,7 @@ describe('ReactIncrementalSideEffects', () => {
return this.props.step !== nextProps.step;
}
render() {
- ReactNoop.yield('Content');
+ Scheduler.yieldValue('Content');
return (
{this.props.step === 0 ? 'Hi' : 'Hello'}
@@ -561,7 +561,7 @@ describe('ReactIncrementalSideEffects', () => {
}
function Foo(props) {
- ReactNoop.yield('Foo');
+ Scheduler.yieldValue('Foo');
return (
@@ -619,7 +619,7 @@ describe('ReactIncrementalSideEffects', () => {
it('can update a completed tree before it has a chance to commit', () => {
function Foo(props) {
- ReactNoop.yield('Foo');
+ Scheduler.yieldValue('Foo');
return
;
}
ReactNoop.render(
);
@@ -901,12 +901,12 @@ describe('ReactIncrementalSideEffects', () => {
this.setState({active: true});
}
render() {
- ReactNoop.yield('Bar');
+ Scheduler.yieldValue('Bar');
return
;
}
}
function Foo(props) {
- ReactNoop.yield('Foo');
+ Scheduler.yieldValue('Foo');
return (
diff --git a/packages/react-reconciler/src/__tests__/ReactIncrementalTriangle-test.internal.js b/packages/react-reconciler/src/__tests__/ReactIncrementalTriangle-test.internal.js
index 23c74dbc63cd2..dc1c3a07c2871 100644
--- a/packages/react-reconciler/src/__tests__/ReactIncrementalTriangle-test.internal.js
+++ b/packages/react-reconciler/src/__tests__/ReactIncrementalTriangle-test.internal.js
@@ -216,7 +216,7 @@ describe('ReactIncrementalTriangle', () => {
}
render() {
if (yieldAfterEachRender) {
- ReactNoop.yield(this);
+ Scheduler.yieldValue(this);
}
const {counter, remainingDepth} = this.props;
return (
diff --git a/packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.internal.js b/packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.internal.js
index a8548a00d7191..26af1eb0014aa 100644
--- a/packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.internal.js
+++ b/packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.internal.js
@@ -34,7 +34,7 @@ describe('ReactIncrementalUpdates', () => {
class Foo extends React.Component {
state = {};
componentDidMount() {
- ReactNoop.yield('commit');
+ Scheduler.yieldValue('commit');
ReactNoop.deferredUpdates(() => {
// Has low priority
this.setState({b: 'b'});
@@ -150,7 +150,7 @@ describe('ReactIncrementalUpdates', () => {
function createUpdate(letter) {
return () => {
- ReactNoop.yield(letter);
+ Scheduler.yieldValue(letter);
return {
[letter]: letter,
};
@@ -221,7 +221,7 @@ describe('ReactIncrementalUpdates', () => {
function createUpdate(letter) {
return () => {
- ReactNoop.yield(letter);
+ Scheduler.yieldValue(letter);
return {
[letter]: letter,
};
@@ -461,9 +461,9 @@ describe('ReactIncrementalUpdates', () => {
const {useEffect} = React;
function App({label}) {
- ReactNoop.yield('Render: ' + label);
+ Scheduler.yieldValue('Render: ' + label);
useEffect(() => {
- ReactNoop.yield('Commit: ' + label);
+ Scheduler.yieldValue('Commit: ' + label);
});
return label;
}
@@ -547,9 +547,9 @@ describe('ReactIncrementalUpdates', () => {
const {useEffect} = React;
function App({label}) {
- ReactNoop.yield('Render: ' + label);
+ Scheduler.yieldValue('Render: ' + label);
useEffect(() => {
- ReactNoop.yield('Commit: ' + label);
+ Scheduler.yieldValue('Commit: ' + label);
});
return label;
}
diff --git a/packages/react-reconciler/src/__tests__/ReactMemo-test.internal.js b/packages/react-reconciler/src/__tests__/ReactMemo-test.internal.js
index a72e9617ba621..b7e9d7e4e8800 100644
--- a/packages/react-reconciler/src/__tests__/ReactMemo-test.internal.js
+++ b/packages/react-reconciler/src/__tests__/ReactMemo-test.internal.js
@@ -36,7 +36,7 @@ describe('memo', () => {
}
function Text(props) {
- ReactNoop.yield(props.text);
+ Scheduler.yieldValue(props.text);
return
;
}
@@ -184,7 +184,7 @@ describe('memo', () => {
return
;
}
Counter = memo(Counter, (oldProps, newProps) => {
- ReactNoop.yield(
+ Scheduler.yieldValue(
`Old count: ${oldProps.count}, New count: ${newProps.count}`,
);
return oldProps.count === newProps.count;
diff --git a/packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js b/packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js
index db65238229175..8e57a6679293a 100644
--- a/packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js
+++ b/packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js
@@ -30,7 +30,7 @@ describe('ReactNewContext', () => {
});
function Text(props) {
- ReactNoop.yield(props.text);
+ Scheduler.yieldValue(props.text);
return
;
}
@@ -160,7 +160,7 @@ describe('ReactNewContext', () => {
const ContextConsumer = getConsumer(Context);
function Provider(props) {
- ReactNoop.yield('Provider');
+ Scheduler.yieldValue('Provider');
return (
{props.children}
@@ -169,11 +169,11 @@ describe('ReactNewContext', () => {
}
function Consumer(props) {
- ReactNoop.yield('Consumer');
+ Scheduler.yieldValue('Consumer');
return (
{value => {
- ReactNoop.yield('Consumer render prop');
+ Scheduler.yieldValue('Consumer render prop');
return ;
}}
@@ -185,13 +185,13 @@ describe('ReactNewContext', () => {
return false;
}
render() {
- ReactNoop.yield('Indirection');
+ Scheduler.yieldValue('Indirection');
return this.props.children;
}
}
function App(props) {
- ReactNoop.yield('App');
+ Scheduler.yieldValue('App');
return (
@@ -229,7 +229,7 @@ describe('ReactNewContext', () => {
const ContextConsumer = getConsumer(Context);
function Provider(props) {
- ReactNoop.yield('Provider');
+ Scheduler.yieldValue('Provider');
return (
{props.children}
@@ -238,11 +238,11 @@ describe('ReactNewContext', () => {
}
function Consumer(props) {
- ReactNoop.yield('Consumer');
+ Scheduler.yieldValue('Consumer');
return (
{value => {
- ReactNoop.yield('Consumer render prop');
+ Scheduler.yieldValue('Consumer render prop');
return ;
}}
@@ -254,13 +254,13 @@ describe('ReactNewContext', () => {
return false;
}
render() {
- ReactNoop.yield('Indirection');
+ Scheduler.yieldValue('Indirection');
return this.props.children;
}
}
function App(props) {
- ReactNoop.yield('App');
+ Scheduler.yieldValue('App');
return (
@@ -463,7 +463,7 @@ describe('ReactNewContext', () => {
const ContextConsumer = getConsumer(Context);
function Provider(props) {
- ReactNoop.yield('Provider');
+ Scheduler.yieldValue('Provider');
return (
{props.children}
@@ -472,11 +472,11 @@ describe('ReactNewContext', () => {
}
function Consumer(props) {
- ReactNoop.yield('Consumer');
+ Scheduler.yieldValue('Consumer');
return (
{value => {
- ReactNoop.yield('Consumer render prop');
+ Scheduler.yieldValue('Consumer render prop');
return ;
}}
@@ -488,13 +488,13 @@ describe('ReactNewContext', () => {
return false;
}
render() {
- ReactNoop.yield('Indirection');
+ Scheduler.yieldValue('Indirection');
return this.props.children;
}
}
function App(props) {
- ReactNoop.yield('App');
+ Scheduler.yieldValue('App');
return (
@@ -605,7 +605,7 @@ describe('ReactNewContext', () => {
return (
{value => {
- ReactNoop.yield('Foo');
+ Scheduler.yieldValue('Foo');
return ;
}}
@@ -616,7 +616,7 @@ describe('ReactNewContext', () => {
return (
{value => {
- ReactNoop.yield('Bar');
+ Scheduler.yieldValue('Bar');
return ;
}}
@@ -704,7 +704,7 @@ describe('ReactNewContext', () => {
return (
{value => {
- ReactNoop.yield('Foo');
+ Scheduler.yieldValue('Foo');
return (
@@ -720,7 +720,7 @@ describe('ReactNewContext', () => {
return (
{value => {
- ReactNoop.yield('Bar');
+ Scheduler.yieldValue('Bar');
return (
@@ -808,7 +808,7 @@ describe('ReactNewContext', () => {
class Child extends React.Component {
state = {step: 0};
render() {
- ReactNoop.yield('Child');
+ Scheduler.yieldValue('Child');
return (
{
{value => {
- ReactNoop.yield('Consumer render prop');
+ Scheduler.yieldValue('Consumer render prop');
return (child = inst)} context={value} />;
}}
@@ -847,24 +847,24 @@ describe('ReactNewContext', () => {
const Consumer = getConsumer(Context);
function renderChildValue(value) {
- ReactNoop.yield('Consumer');
+ Scheduler.yieldValue('Consumer');
return ;
}
function ChildWithInlineRenderCallback() {
- ReactNoop.yield('ChildWithInlineRenderCallback');
+ Scheduler.yieldValue('ChildWithInlineRenderCallback');
// Note: we are intentionally passing an inline arrow. Don't refactor.
return {value => renderChildValue(value)};
}
function ChildWithCachedRenderCallback() {
- ReactNoop.yield('ChildWithCachedRenderCallback');
+ Scheduler.yieldValue('ChildWithCachedRenderCallback');
return {renderChildValue};
}
class PureIndirection extends React.PureComponent {
render() {
- ReactNoop.yield('PureIndirection');
+ Scheduler.yieldValue('PureIndirection');
return (
@@ -876,7 +876,7 @@ describe('ReactNewContext', () => {
class App extends React.Component {
render() {
- ReactNoop.yield('App');
+ Scheduler.yieldValue('App');
return (
@@ -988,7 +988,7 @@ describe('ReactNewContext', () => {
};
render() {
- ReactNoop.yield('App');
+ Scheduler.yieldValue('App');
return (
@@ -1016,7 +1016,7 @@ describe('ReactNewContext', () => {
return (
{value => {
- ReactNoop.yield('Consumer');
+ Scheduler.yieldValue('Consumer');
return ;
}}
@@ -1079,7 +1079,7 @@ describe('ReactNewContext', () => {
const Context = React.createContext(0);
function Foo(props) {
- ReactNoop.yield('Foo');
+ Scheduler.yieldValue('Foo');
return null;
}
@@ -1119,14 +1119,14 @@ describe('ReactNewContext', () => {
const Context = React.createContext(0);
function Child() {
- ReactNoop.yield('Child');
+ Scheduler.yieldValue('Child');
return ;
}
const children = ;
function App(props) {
- ReactNoop.yield('App');
+ Scheduler.yieldValue('App');
return (
{children}
);
@@ -1150,7 +1150,7 @@ describe('ReactNewContext', () => {
const Context = React.createContext(0);
function Child() {
- ReactNoop.yield('Child');
+ Scheduler.yieldValue('Child');
return ;
}
@@ -1165,7 +1165,7 @@ describe('ReactNewContext', () => {
return {legacyValue: this.state.legacyValue};
}
render() {
- ReactNoop.yield('LegacyProvider');
+ Scheduler.yieldValue('LegacyProvider');
return this.props.children;
}
}
@@ -1173,7 +1173,7 @@ describe('ReactNewContext', () => {
class App extends React.Component {
state = {value: 1};
render() {
- ReactNoop.yield('App');
+ Scheduler.yieldValue('App');
return (
{this.props.children}
@@ -1299,12 +1299,12 @@ describe('ReactNewContext', () => {
};
renderConsumer = context => {
- ReactNoop.yield('App#renderConsumer');
+ Scheduler.yieldValue('App#renderConsumer');
return ;
};
render() {
- ReactNoop.yield('App');
+ Scheduler.yieldValue('App');
return (
{this.renderConsumer}
@@ -1439,12 +1439,12 @@ describe('ReactNewContext', () => {
};
renderConsumer = context => {
- ReactNoop.yield('App#renderConsumer');
+ Scheduler.yieldValue('App#renderConsumer');
return ;
};
render() {
- ReactNoop.yield('App');
+ Scheduler.yieldValue('App');
return (
{this.renderConsumer}
@@ -1566,12 +1566,12 @@ describe('ReactNewContext', () => {
};
renderConsumer = context => {
- ReactNoop.yield('App#renderConsumer');
+ Scheduler.yieldValue('App#renderConsumer');
return ;
};
render() {
- ReactNoop.yield('App');
+ Scheduler.yieldValue('App');
return (
{this.renderConsumer}
@@ -1694,7 +1694,7 @@ describe('ReactNewContext', () => {
return false;
}
render() {
- ReactNoop.yield();
+ Scheduler.yieldValue();
if (this.props.depth >= this.props.maxDepth) {
return null;
}
diff --git a/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.internal.js b/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.internal.js
index 8c8086d8d3f74..6e8727d0c64ef 100644
--- a/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.internal.js
+++ b/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.internal.js
@@ -33,10 +33,10 @@ describe('ReactSuspenseWithNoopRenderer', () => {
return new Promise((resolve, reject) =>
setTimeout(() => {
if (textResourceShouldFail) {
- ReactNoop.yield(`Promise rejected [${text}]`);
+ Scheduler.yieldValue(`Promise rejected [${text}]`);
reject(new Error('Failed to load: ' + text));
} else {
- ReactNoop.yield(`Promise resolved [${text}]`);
+ Scheduler.yieldValue(`Promise resolved [${text}]`);
resolve(text);
}
}, ms),
@@ -69,7 +69,7 @@ describe('ReactSuspenseWithNoopRenderer', () => {
}
function Text(props) {
- ReactNoop.yield(props.text);
+ Scheduler.yieldValue(props.text);
return ;
}
@@ -77,13 +77,13 @@ describe('ReactSuspenseWithNoopRenderer', () => {
const text = props.text;
try {
TextResource.read([props.text, props.ms]);
- ReactNoop.yield(text);
+ Scheduler.yieldValue(text);
return ;
} catch (promise) {
if (typeof promise.then === 'function') {
- ReactNoop.yield(`Suspend! [${text}]`);
+ Scheduler.yieldValue(`Suspend! [${text}]`);
} else {
- ReactNoop.yield(`Error! [${text}]`);
+ Scheduler.yieldValue(`Error! [${text}]`);
}
throw promise;
}
@@ -91,12 +91,12 @@ describe('ReactSuspenseWithNoopRenderer', () => {
it('suspends rendering and continues later', async () => {
function Bar(props) {
- ReactNoop.yield('Bar');
+ Scheduler.yieldValue('Bar');
return props.children;
}
function Foo() {
- ReactNoop.yield('Foo');
+ Scheduler.yieldValue('Foo');
return (
}>
@@ -758,10 +758,10 @@ describe('ReactSuspenseWithNoopRenderer', () => {
it('flushes all expired updates in a single batch', async () => {
class Foo extends React.Component {
componentDidUpdate() {
- ReactNoop.yield('Commit: ' + this.props.text);
+ Scheduler.yieldValue('Commit: ' + this.props.text);
}
componentDidMount() {
- ReactNoop.yield('Commit: ' + this.props.text);
+ Scheduler.yieldValue('Commit: ' + this.props.text);
}
render() {
return (
@@ -919,7 +919,7 @@ describe('ReactSuspenseWithNoopRenderer', () => {
// Update. This starts out asynchronously.
text.current.setState({step: 2}, () =>
- ReactNoop.yield('Update did commit'),
+ Scheduler.yieldValue('Update did commit'),
);
// Suspend during an async render.
@@ -1001,7 +1001,7 @@ describe('ReactSuspenseWithNoopRenderer', () => {
// Initial mount
ReactNoop.renderLegacySyncRoot(, () =>
- ReactNoop.yield('Did mount'),
+ Scheduler.yieldValue('Did mount'),
);
await advanceTimers(100);
expect(Scheduler).toHaveYielded([
@@ -1030,10 +1030,10 @@ describe('ReactSuspenseWithNoopRenderer', () => {
// Update. This starts out asynchronously.
text1.current.setState({text: 'Async: 2'}, () =>
- ReactNoop.yield('Update 1 did commit'),
+ Scheduler.yieldValue('Update 1 did commit'),
);
text2.current.setState({text: 'Sync: 2'}, () =>
- ReactNoop.yield('Update 2 did commit'),
+ Scheduler.yieldValue('Update 2 did commit'),
);
// Start rendering asynchronously
@@ -1136,7 +1136,7 @@ describe('ReactSuspenseWithNoopRenderer', () => {
// Initial mount
ReactNoop.renderLegacySyncRoot(, () =>
- ReactNoop.yield('Did mount'),
+ Scheduler.yieldValue('Did mount'),
);
await advanceTimers(100);
expect(Scheduler).toHaveYielded([
@@ -1165,10 +1165,10 @@ describe('ReactSuspenseWithNoopRenderer', () => {
// Update. This starts out asynchronously.
text1.current.setState({text: 'Async: 2'}, () =>
- ReactNoop.yield('Update 1 did commit'),
+ Scheduler.yieldValue('Update 1 did commit'),
);
text2.current.setState({text: 'Sync: 2'}, () =>
- ReactNoop.yield('Update 2 did commit'),
+ Scheduler.yieldValue('Update 2 did commit'),
);
// Start rendering asynchronously
@@ -1226,10 +1226,10 @@ describe('ReactSuspenseWithNoopRenderer', () => {
it('does not re-render siblings in loose mode', async () => {
class TextWithLifecycle extends React.Component {
componentDidMount() {
- ReactNoop.yield(`Mount [${this.props.text}]`);
+ Scheduler.yieldValue(`Mount [${this.props.text}]`);
}
componentDidUpdate() {
- ReactNoop.yield(`Update [${this.props.text}]`);
+ Scheduler.yieldValue(`Update [${this.props.text}]`);
}
render() {
return ;
@@ -1238,10 +1238,10 @@ describe('ReactSuspenseWithNoopRenderer', () => {
class AsyncTextWithLifecycle extends React.Component {
componentDidMount() {
- ReactNoop.yield(`Mount [${this.props.text}]`);
+ Scheduler.yieldValue(`Mount [${this.props.text}]`);
}
componentDidUpdate() {
- ReactNoop.yield(`Update [${this.props.text}]`);
+ Scheduler.yieldValue(`Update [${this.props.text}]`);
}
render() {
return ;
@@ -1261,7 +1261,7 @@ describe('ReactSuspenseWithNoopRenderer', () => {
}
ReactNoop.renderLegacySyncRoot(, () =>
- ReactNoop.yield('Commit root'),
+ Scheduler.yieldValue('Commit root'),
);
expect(Scheduler).toHaveYielded([
'A',
@@ -1303,24 +1303,24 @@ describe('ReactSuspenseWithNoopRenderer', () => {
constructor(props) {
super(props);
const text = props.text;
- ReactNoop.yield('constructor');
+ Scheduler.yieldValue('constructor');
try {
TextResource.read([props.text, props.ms]);
this.state = {text};
} catch (promise) {
if (typeof promise.then === 'function') {
- ReactNoop.yield(`Suspend! [${text}]`);
+ Scheduler.yieldValue(`Suspend! [${text}]`);
} else {
- ReactNoop.yield(`Error! [${text}]`);
+ Scheduler.yieldValue(`Error! [${text}]`);
}
throw promise;
}
}
componentDidMount() {
- ReactNoop.yield('componentDidMount');
+ Scheduler.yieldValue('componentDidMount');
}
render() {
- ReactNoop.yield(this.state.text);
+ Scheduler.yieldValue(this.state.text);
return ;
}
}
@@ -1394,7 +1394,7 @@ describe('ReactSuspenseWithNoopRenderer', () => {
const child = useRef(null);
useLayoutEffect(() => {
- ReactNoop.yield('Child is hidden: ' + child.current.hidden);
+ Scheduler.yieldValue('Child is hidden: ' + child.current.hidden);
});
return (
@@ -1430,13 +1430,13 @@ describe('ReactSuspenseWithNoopRenderer', () => {
it('does not call lifecycles of a suspended component', async () => {
class TextWithLifecycle extends React.Component {
componentDidMount() {
- ReactNoop.yield(`Mount [${this.props.text}]`);
+ Scheduler.yieldValue(`Mount [${this.props.text}]`);
}
componentDidUpdate() {
- ReactNoop.yield(`Update [${this.props.text}]`);
+ Scheduler.yieldValue(`Update [${this.props.text}]`);
}
componentWillUnmount() {
- ReactNoop.yield(`Unmount [${this.props.text}]`);
+ Scheduler.yieldValue(`Unmount [${this.props.text}]`);
}
render() {
return ;
@@ -1445,26 +1445,26 @@ describe('ReactSuspenseWithNoopRenderer', () => {
class AsyncTextWithLifecycle extends React.Component {
componentDidMount() {
- ReactNoop.yield(`Mount [${this.props.text}]`);
+ Scheduler.yieldValue(`Mount [${this.props.text}]`);
}
componentDidUpdate() {
- ReactNoop.yield(`Update [${this.props.text}]`);
+ Scheduler.yieldValue(`Update [${this.props.text}]`);
}
componentWillUnmount() {
- ReactNoop.yield(`Unmount [${this.props.text}]`);
+ Scheduler.yieldValue(`Unmount [${this.props.text}]`);
}
render() {
const text = this.props.text;
const ms = this.props.ms;
try {
TextResource.read([text, ms]);
- ReactNoop.yield(text);
+ Scheduler.yieldValue(text);
return ;
} catch (promise) {
if (typeof promise.then === 'function') {
- ReactNoop.yield(`Suspend! [${text}]`);
+ Scheduler.yieldValue(`Suspend! [${text}]`);
} else {
- ReactNoop.yield(`Error! [${text}]`);
+ Scheduler.yieldValue(`Error! [${text}]`);
}
throw promise;
}
@@ -1484,7 +1484,7 @@ describe('ReactSuspenseWithNoopRenderer', () => {
}
ReactNoop.renderLegacySyncRoot(, () =>
- ReactNoop.yield('Commit root'),
+ Scheduler.yieldValue('Commit root'),
);
expect(Scheduler).toHaveYielded([
'A',
diff --git a/packages/react/src/__tests__/ReactProfiler-test.internal.js b/packages/react/src/__tests__/ReactProfiler-test.internal.js
index 22c7c2198f4f3..7d8bcf65108cc 100644
--- a/packages/react/src/__tests__/ReactProfiler-test.internal.js
+++ b/packages/react/src/__tests__/ReactProfiler-test.internal.js
@@ -1208,13 +1208,13 @@ describe('Profiler', () => {
const Child = ({duration, id}) => {
Scheduler.advanceTime(duration);
- ReactNoop.yield(`Child:render:${id}`);
+ Scheduler.yieldValue(`Child:render:${id}`);
return null;
};
class Parent extends React.Component {
componentDidMount() {
- ReactNoop.yield(`Parent:componentDidMount:${this.props.id}`);
+ Scheduler.yieldValue(`Parent:componentDidMount:${this.props.id}`);
}
render() {
const {duration, id} = this.props;
@@ -2261,7 +2261,7 @@ describe('Profiler', () => {
const monkey = React.createRef();
class Monkey extends React.Component {
render() {
- ReactNoop.yield('Monkey');
+ Scheduler.yieldValue('Monkey');
return null;
}
}
diff --git a/packages/react/src/__tests__/forwardRef-test.internal.js b/packages/react/src/__tests__/forwardRef-test.internal.js
index f815bdbf72d47..3391e98dd1585 100644
--- a/packages/react/src/__tests__/forwardRef-test.internal.js
+++ b/packages/react/src/__tests__/forwardRef-test.internal.js
@@ -28,7 +28,7 @@ describe('forwardRef', () => {
it('should work without a ref to be forwarded', () => {
class Child extends React.Component {
render() {
- ReactNoop.yield(this.props.value);
+ Scheduler.yieldValue(this.props.value);
return null;
}
}
@@ -48,7 +48,7 @@ describe('forwardRef', () => {
it('should forward a ref for a single child', () => {
class Child extends React.Component {
render() {
- ReactNoop.yield(this.props.value);
+ Scheduler.yieldValue(this.props.value);
return null;
}
}
@@ -71,7 +71,7 @@ describe('forwardRef', () => {
it('should forward a ref for multiple children', () => {
class Child extends React.Component {
render() {
- ReactNoop.yield(this.props.value);
+ Scheduler.yieldValue(this.props.value);
return null;
}
}
@@ -103,7 +103,7 @@ describe('forwardRef', () => {
super(props);
}
render() {
- ReactNoop.yield(this.props.value);
+ Scheduler.yieldValue(this.props.value);
return null;
}
}
@@ -138,28 +138,28 @@ describe('forwardRef', () => {
class ErrorBoundary extends React.Component {
state = {error: null};
componentDidCatch(error) {
- ReactNoop.yield('ErrorBoundary.componentDidCatch');
+ Scheduler.yieldValue('ErrorBoundary.componentDidCatch');
this.setState({error});
}
render() {
if (this.state.error) {
- ReactNoop.yield('ErrorBoundary.render: catch');
+ Scheduler.yieldValue('ErrorBoundary.render: catch');
return null;
}
- ReactNoop.yield('ErrorBoundary.render: try');
+ Scheduler.yieldValue('ErrorBoundary.render: try');
return this.props.children;
}
}
class BadRender extends React.Component {
render() {
- ReactNoop.yield('BadRender throw');
+ Scheduler.yieldValue('BadRender throw');
throw new Error('oops!');
}
}
function Wrapper(props) {
- ReactNoop.yield('Wrapper');
+ Scheduler.yieldValue('Wrapper');
return ;
}
@@ -196,24 +196,24 @@ describe('forwardRef', () => {
class Inner extends React.Component {
render() {
- ReactNoop.yield('Inner');
+ Scheduler.yieldValue('Inner');
inst = this;
return ;
}
}
function Middle(props) {
- ReactNoop.yield('Middle');
+ Scheduler.yieldValue('Middle');
return ;
}
const Forward = React.forwardRef((props, ref) => {
- ReactNoop.yield('Forward');
+ Scheduler.yieldValue('Forward');
return ;
});
function App() {
- ReactNoop.yield('App');
+ Scheduler.yieldValue('App');
return ;
}