Skip to content

Commit

Permalink
Remove unstable_deferredUpdates
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Aug 27, 2018
1 parent ebdca9f commit b67ab91
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions fixtures/unstable-async/suspense/src/components/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {Placeholder, PureComponent} from 'react';
import {unstable_deferredUpdates} from 'react-dom';
import {createResource} from 'simple-cache-provider';
import {cache} from '../cache';
import Spinner from './Spinner';
Expand Down Expand Up @@ -31,7 +30,7 @@ export default class App extends PureComponent {
this.setState({
currentId: id,
});
unstable_deferredUpdates(() => {
requestIdleCallback(() => {
this.setState({
showDetail: true,
});
Expand Down
6 changes: 3 additions & 3 deletions fixtures/unstable-async/time-slicing/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {PureComponent, unstable_AsyncMode} from 'react';
import {flushSync, render, unstable_deferredUpdates} from 'react-dom';
import {flushSync, render} from 'react-dom';
import _ from 'lodash';
import Charts from './Charts';
import Clock from './Clock';
Expand Down Expand Up @@ -64,7 +64,7 @@ class App extends PureComponent {
}
this._ignoreClick = true;

unstable_deferredUpdates(() => {
requestIdleCallback(() => {
this.setState({showDemo: true}, () => {
this._ignoreClick = false;
});
Expand Down Expand Up @@ -104,7 +104,7 @@ class App extends PureComponent {
this.debouncedHandleChange(value);
break;
case 'async':
unstable_deferredUpdates(() => {
requestIdleCallback(() => {
this.setState({value});
});
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('ReactDOMFiberAsync', () => {

handleChange = e => {
const nextValue = e.target.value;
ReactDOM.unstable_deferredUpdates(() => {
requestIdleCallback(() => {
this.setState({
asyncValue: nextValue,
});
Expand Down
2 changes: 0 additions & 2 deletions packages/react-dom/src/client/ReactDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,6 @@ const ReactDOM: Object = {

unstable_batchedUpdates: DOMRenderer.batchedUpdates,

unstable_deferredUpdates: DOMRenderer.deferredUpdates,

unstable_interactiveUpdates: DOMRenderer.interactiveUpdates,

flushSync: DOMRenderer.flushSync,
Expand Down

0 comments on commit b67ab91

Please sign in to comment.