Skip to content

Commit

Permalink
Merge pull request #31 from ecreeth/patch-1
Browse files Browse the repository at this point in the history
Rename createSyncRoot to createBlockingRoot
  • Loading branch information
swyxio authored Oct 24, 2019
2 parents ba6397a + 36edb59 commit 867c049
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apis/roots.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ These are concurrent-ready attachment points for React onto the DOM.

## `ReactDOM.createRoot and Root.render`

API: `ReactDOM.unstable_createRoot`
API: `ReactDOM.createRoot`

Instead of `ReactDOM.render`, `ReactDOM.createRoot` creates a Concurrent root for React. It also doesn't assume the first render is synchronous (aka you can suspend even on the first render, which useful for prerendering via `root.createBatch()`).

Expand All @@ -21,16 +21,16 @@ const root = ReactDOM.createRoot(container);
root.render(<App />);
```

## `ReactDOM.createSyncRoot`
## `ReactDOM.createBlockingRoot`

API: `ReactDOM.unstable_createSyncRoot`
API: `ReactDOM.createBlockingRoot

Create a Batched Mode root. It does not support `createBatch`.


```js
const container = document.getElementById('root');
const root = ReactDOM.createSyncRoot(container);
const root = ReactDOM.createBlockingRoot(container);
root.render(<App />);
```

Expand Down

0 comments on commit 867c049

Please sign in to comment.