Skip to content

Commit d126a31

Browse files
committed
Add concurrent mode questions
1 parent 6719d55 commit d126a31

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@
332332
|316| [What is MobX?](#what-is-mobx)|
333333
|317| [What are the differences between Redux and MobX?](#what-are-the-differences-between-redux-and-mobx)|
334334
|318| [Should I learn ES6 before learning ReactJS?](#should-i-learn-es6-before-learning-reactjs)|
335+
|319| [What is Concurrent Rendering?](#what-is-concurrent-rendering)|
336+
|320| [What is the difference between async mode and concurrent mode?](#what-is-the-difference-between-async-mode-and-concurrent-mode)|
335337

336338
## Core React
337339

@@ -5226,3 +5228,16 @@
52265228
// es 6
52275229
const users = usersList.map(user => <li>{user.name}</li>);
52285230
```
5231+
319. ### What is Concurrent Rendering?
5232+
The Concurrent rendering makes React apps to be more responsive by rendering component trees without blocking the main UI thread. It allows React to interrupt a long-running render to handle a high-priority event. i.e, When you enabled concurrent Mode, React will keep an eye on other tasks that need to be done, and if there's something with a higher priority it will pause what it is currently rendering and let the other task finish first. You can enable this in two ways,
5233+
```javascript
5234+
// 1. Part of an app by wrapping with ConcurrentMode
5235+
<React.unstable_ConcurrentMode>
5236+
<Something />
5237+
</React.unstable_ConcurrentMode>
5238+
5239+
// 2. Whole app using createRoot
5240+
ReactDOM.unstable_createRoot(domNode).render(<App />);
5241+
```
5242+
320. ### What is the difference between async mode and concurrent mode?
5243+
Both refers the same thing. Previously concurrent Mode being referred to as "Async Mode" by React team. The name has been changed to highlight React’s ability to perform work on different priority levels. So it avoids the confusion from other approaches to Async Rendering.

0 commit comments

Comments
 (0)