SlideShare a Scribd company logo
Concurrent React
wednesday.is
Presented by:Aditya Doshi
2
Content
What we’ll be covering
What exactly react concurrent mode is
How it works behind the scenes
Code Examples
React new features, apis to run concurrent mode
3
Concurrent Mode
The what and the why?
Concurrent mode is a set of new features that help React app stay responsive and
gracefully adjust to the user’s device capabilities and network speed.
Concurrent react can work on multiple tasks at a time, and switch between them
according to priority.
4
Use cases
Concurrent react can partially render a tree without committing the result
Example
React can start rendering an update & if it hit’s a component that hasn’t finished loading for
instance, react can wait for it to complete before it continues & it doesn’t immediately has
to show a fallback or a spinner.
5
Thread
The what and the why?
Concurrent react does not block the main thread.
So today when react updates a component, it’s going to do all of the work in a single
uninterruptible block on the main thread.
User events fire in the main thread, so the issue is, when react is rendering an update & in
the meantime user tries to type into the input, it would not be able to process until the re-
render is completed.
But in concurrent react, it’s going to pause the current render, it’s going to switch to
complete the user blocking task & then resume afterwards on the original rendering part.
Also referred to time slicing - ability to split work into chunks and spread it’s execution of
time.
6
Comparing with code splitting
Code splitting usage & a limitation
Usage: Instead of sending all of the code for the initial payload, we send down what’s
needed for the first screen & we defer the rest to later, maybe with lazy loading, navigation.
Limitation: If the view hasn’t finished loading, what do you display to the user? Maybe a
spinner, placeholder.
7
Concurrent react is not blocking
You can render large amount of work without blocking user inputs or other high priority
tasks on the main thread.
8
startTransitionAPI
Lets you mark updates inside the provided callback as transitions.
Updates in a transition will not show a fallback for re-suspended content, allowing the user
to continue interacting while rendering the update.
wednesday.is
useTransition hook
useTransition hook provides access to two variables - startTransition &
isPending
It is a function which will tell react which render are less important, isPending is a boolean that
tells us weather our list is pending to be rendered or not
10
Suspense for data fetching
It allows to show a placeholder while waiting for a code split part of our application.
Asimilar way to work as transition but here it works anything using promises.
To work with suspense, we need to wrap promises with a function wrapPromise which
returns different values based on what suspense is expecting on each step of the process.
11
Key Takeaways
What we learned
How concurrent mode works
Thread execution
Code splitting
Code examples
Thank you
for your time
wednesday.is

More Related Content

PDF
How to increase the ui performance of apps designed using react
PDF
Concurrency and parallel in .net
PPTX
an Introduction to Redux
PPTX
Stéphane Nicoll and Madhura Bhave at SpringOne Platform 2017
PDF
React Interview Question PDF By ScholarHat
PPTX
React JS Interview Question & Answer
PPTX
Angular interview questions
PPTX
React-JS.pptx
How to increase the ui performance of apps designed using react
Concurrency and parallel in .net
an Introduction to Redux
Stéphane Nicoll and Madhura Bhave at SpringOne Platform 2017
React Interview Question PDF By ScholarHat
React JS Interview Question & Answer
Angular interview questions
React-JS.pptx

Similar to What is React Concurrent Mode: A Walkthrough (20)

PPTX
React JS: A Secret Preview
PDF
React JS Interview Questions PDF By ScholarHat
PDF
The complete-beginners-guide-to-react dyrr
PPTX
Reactive programming with rx java
PDF
Everything to Know About React Re-Rendering: A Comprehensive Guide
PDF
Top 7 Angular Best Practices to Organize Your Angular App
PDF
Top 5 React Performance Optimization Techniques in 2023
PPTX
Android Dagger 2
PDF
Tech Talk on ReactJS
PPTX
Easy job scheduling with android
PDF
React Interview Questions for Noobs or Juniors
PDF
Fundamental concepts of react js
PPTX
Андрій Рева, "How to build reactive java application"
PDF
How can JAVA Performance tuning speed up applications.pdf
PPTX
What are the components in React?
PPTX
Introduction to dependency injection in Scala (Play)
PPTX
React gsg presentation with ryan jung & elias malik
PDF
reactjs interview questions.pdf
PDF
10 Ways to Boost the Performance of React Native Apps.pdf
DOCX
If the Android platform you are developing for does not support fragme.docx
React JS: A Secret Preview
React JS Interview Questions PDF By ScholarHat
The complete-beginners-guide-to-react dyrr
Reactive programming with rx java
Everything to Know About React Re-Rendering: A Comprehensive Guide
Top 7 Angular Best Practices to Organize Your Angular App
Top 5 React Performance Optimization Techniques in 2023
Android Dagger 2
Tech Talk on ReactJS
Easy job scheduling with android
React Interview Questions for Noobs or Juniors
Fundamental concepts of react js
Андрій Рева, "How to build reactive java application"
How can JAVA Performance tuning speed up applications.pdf
What are the components in React?
Introduction to dependency injection in Scala (Play)
React gsg presentation with ryan jung & elias malik
reactjs interview questions.pdf
10 Ways to Boost the Performance of React Native Apps.pdf
If the Android platform you are developing for does not support fragme.docx
Ad

More from Wednesday Solutions (8)

PDF
Error Handling in Express
PDF
Master iOS Performance Optimization with Instruments
PDF
Memory Management in Go: Stack, Heap & Garbage Collector
PDF
Create Basic 3D Scenes Using Three.js
PDF
A Guide to Figma for Developers
PDF
What is Temporal: Workflow & Cluster
PDF
Vector Embedding using AI
PDF
What is GraphQL: Best Practices
Error Handling in Express
Master iOS Performance Optimization with Instruments
Memory Management in Go: Stack, Heap & Garbage Collector
Create Basic 3D Scenes Using Three.js
A Guide to Figma for Developers
What is Temporal: Workflow & Cluster
Vector Embedding using AI
What is GraphQL: Best Practices
Ad

Recently uploaded (20)

PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PPT
introduction to datamining and warehousing
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
composite construction of structures.pdf
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Current and future trends in Computer Vision.pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
DOCX
573137875-Attendance-Management-System-original
PPTX
Artificial Intelligence
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPT
Project quality management in manufacturing
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
introduction to datamining and warehousing
OOP with Java - Java Introduction (Basics)
Lecture Notes Electrical Wiring System Components
Model Code of Practice - Construction Work - 21102022 .pdf
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
composite construction of structures.pdf
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Current and future trends in Computer Vision.pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
CYBER-CRIMES AND SECURITY A guide to understanding
573137875-Attendance-Management-System-original
Artificial Intelligence
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Project quality management in manufacturing
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx

What is React Concurrent Mode: A Walkthrough

  • 2. 2 Content What we’ll be covering What exactly react concurrent mode is How it works behind the scenes Code Examples React new features, apis to run concurrent mode
  • 3. 3 Concurrent Mode The what and the why? Concurrent mode is a set of new features that help React app stay responsive and gracefully adjust to the user’s device capabilities and network speed. Concurrent react can work on multiple tasks at a time, and switch between them according to priority.
  • 4. 4 Use cases Concurrent react can partially render a tree without committing the result Example React can start rendering an update & if it hit’s a component that hasn’t finished loading for instance, react can wait for it to complete before it continues & it doesn’t immediately has to show a fallback or a spinner.
  • 5. 5 Thread The what and the why? Concurrent react does not block the main thread. So today when react updates a component, it’s going to do all of the work in a single uninterruptible block on the main thread. User events fire in the main thread, so the issue is, when react is rendering an update & in the meantime user tries to type into the input, it would not be able to process until the re- render is completed. But in concurrent react, it’s going to pause the current render, it’s going to switch to complete the user blocking task & then resume afterwards on the original rendering part. Also referred to time slicing - ability to split work into chunks and spread it’s execution of time.
  • 6. 6 Comparing with code splitting Code splitting usage & a limitation Usage: Instead of sending all of the code for the initial payload, we send down what’s needed for the first screen & we defer the rest to later, maybe with lazy loading, navigation. Limitation: If the view hasn’t finished loading, what do you display to the user? Maybe a spinner, placeholder.
  • 7. 7 Concurrent react is not blocking You can render large amount of work without blocking user inputs or other high priority tasks on the main thread.
  • 8. 8 startTransitionAPI Lets you mark updates inside the provided callback as transitions. Updates in a transition will not show a fallback for re-suspended content, allowing the user to continue interacting while rendering the update.
  • 9. wednesday.is useTransition hook useTransition hook provides access to two variables - startTransition & isPending It is a function which will tell react which render are less important, isPending is a boolean that tells us weather our list is pending to be rendered or not
  • 10. 10 Suspense for data fetching It allows to show a placeholder while waiting for a code split part of our application. Asimilar way to work as transition but here it works anything using promises. To work with suspense, we need to wrap promises with a function wrapPromise which returns different values based on what suspense is expecting on each step of the process.
  • 11. 11 Key Takeaways What we learned How concurrent mode works Thread execution Code splitting Code examples
  • 12. Thank you for your time wednesday.is