Skip to content

Commit

Permalink
AsyncMode cannot be a base class of React Components
Browse files Browse the repository at this point in the history
  • Loading branch information
koba04 committed Mar 21, 2018
1 parent bbcb3a2 commit 3f7ed14
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,12 @@ ReactDOM.unstable_deferredUpdates(() => {

`React.unstable_AsyncMode` is a Component to make updates in child components asynchronous, which means the updates are treated as Low Priority.

You can use `React.unstable_AsyncMode` as just a component or as a base class like PureComponent.

```js
const AsyncMode = React.unstable_AsyncMode;

<AsyncMode>
<App /> // Low Priority by default
</AsyncMode>

// Low Priority by default
const App extends AsyncMode {
render() {
return <Child />
}
}
```

If you'd like to use synchronous updates inside the component, you can use `ReactDOM.flushSync(cb)`.
Expand Down

0 comments on commit 3f7ed14

Please sign in to comment.