SlideShare a Scribd company logo
#ScottishSummit2021
M a u r i c e d e B e i j e r
W h y I a m h o o k e d o n t h e f u t u r e o f R e a c t
S a t 1 5 : 0 0 — 4 5 m i n
Our Sponsors
T h e P r o b l e m S o l v e r
F o u n d e r / T r a i n e r / L e a d
@ m a u r i c e d b
Maurice
De Beijer
Agenda
Future
• Concurrent Rendering
• useTransition()
• <SuspenseList />
• Server Components
Today
• Asynchronous Data:
• Class based components
• Functional components
• Component hooks
• Resources
• <Suspense />
#ScottishSummit2021
Used to be the most common way to write React components
Class
Components
Houston we
have a
problem!
The problem
with classes
Fat arrow for some functions!
But not for other functions? 🤔
Fat arrows
If all you have is a
hammer
Scottish
Summit
Template
Then every problem looks like a nail
Deeply Nested
Components
Goes Here
Scottish
Summit
Template
Basic
ComponentHo
oks
Scottish
Summit
Template
• Manage state in a functional component
• Returns a tuple with:
• The current state
• An updater function
useState()
hook
• Manage side effects in a functional component
• Takes a function that contains the side effect
• Optional: Can return a clean-up function
👉 Always use the second argument with dependencies
useEffect()
hook
React Context
Scottish
Summit
Template
It’s all a matter of perspective
A flexible but hard to use pattern 😢
Render Props
Returns the current context value for a given context
useContext()
hook
Other hooks
Scottish
Summit
Template
• useReducer is an alternative to useState
and accepts a reducer function
• useCallback returns a memoized
callback
• useMemo returns a memoized value
• useRef returns a mutable ref object
whose .current property is initialized to
the passed argument
Additional
Hooks
• useImperativeHandle customizes the instance
value that is exposed to parent components
when using ref
• useLayoutEffect is like useEffect, but it fires
synchronously after all DOM mutations
• useDebugValue can be used to display a label
for custom hooks in React DevTools
Additional
Hooks
Custom hooks
Scottish
Summit
Template
Reuse shared logic between components
Custom hooks
Simplify the functional component even more
Hooks can’t be used in class based components 😢
Using the
custom hook
Rules of hooks
Scottish
Summit
Template
Data Fetching
using Suspense
Scottish
Summit
Template
• Load asynchronous data
• Suspends rendering the closest <Suspense> component
• 💡 Throw a promise to suspend!
See this gist from Ryan Florence
Resource
Manager
A resource using fetch() to load some data
AJAX
Resource
• Fetching asynchronous data
• Suspends rendering the closest <Suspense> component if
not ready
👉 Use an <ErrorBoundary> to handle errors
Fetching the
resource
<Suspense />
Goes Here
Scottish
Summit
Template
• Suspend rendering when one or more of the child
components is not ready
• Display a fallback component instead
👉 Handle errors the standard React way
<Suspense />
What is next
for React?
Scottish
Summit
Template
Concurrent
Rendering
• Changes how React renders your components
• The render phase is split into chunks and can be
interrupted/aborted and restarted
• The commit phase is still atomic
• No partial screen updates
Concurrent
Rendering
While React is rendering components
User clicks
When React is completely done rendering
The event
executes
React rendering is chunked into slices
Concurrent
mode
When a slice is done
• It can invalidate the render so far and restart it
• Render functions will be called multiple times
The event
executes
useTransition()
Scottish
Summit
Template
Transition between application states in a more controlled
manner
useTransition()
<SuspenseList />
Scottish
Summit
Template
• Control how multiple <Suspense> boundaries are rendered
• For example:
Prevents multiple loading indicators at the same time
<SuspenseList />
• They only run on the server, not on the client
• Can use a database, file or similar resource
• Can’t use hooks like setState or useEffect
• Can render other server or client components
• Client components can only render other client
components
Server
Components
Scottish
Summit
Template
Server components only run on the server
They can use a database, file or similar resource
But they can’t use hooks like useState or useEffect
They can render other server or client components
Client components only run on the client
They can only render other client components
Regular components can run on both client and server
Depending on who renders them
Server
Components
• This isn’t server side rendering
Server components send a special serialization format
• SSR would return HTML to the client
Server Side
Rendering?
#ScottishSummit2021
Thank You

More Related Content

PPTX
Building Reliable Applications Using React, .NET & Azure
PPTX
Setting Up Development Environment For Google App Engine & Python | Talentica
PDF
Start with Angular framework
PPTX
Testing of React JS app
PDF
Intro To React Native
PPTX
Migration from AngularJS to Angular
PDF
Using JHipster for generating Angular/Spring Boot apps
PDF
Getting Started with React Native (and should I use it at all?)
Building Reliable Applications Using React, .NET & Azure
Setting Up Development Environment For Google App Engine & Python | Talentica
Start with Angular framework
Testing of React JS app
Intro To React Native
Migration from AngularJS to Angular
Using JHipster for generating Angular/Spring Boot apps
Getting Started with React Native (and should I use it at all?)

What's hot (20)

PDF
Serverless
PDF
Type script for_java_dev_jul_2020
PDF
Matheus Marsiglio - Isomorphic React + Redux App
PDF
Stripe con 2021 UI stack
PPTX
“ASP.NET Core. Features and architecture”
PDF
Raphael Amorim - Scrating React Fiber
PPT
Integration and Acceptance Testing
PPTX
Concurrent Rendering Adventures in React 18
PDF
Azure functions
PDF
The complete-beginners-guide-to-react dyrr
PPTX
Blazor and Azure Functions - a serverless approach
PDF
Introduction to React Native
PPTX
React.js - The Dawn of Virtual DOM
PPTX
LONDON SDET MEETUP - Difference between Selenium and Cypress presentation
PPTX
Fullstack workshop
PPTX
ASP.NET Core
PDF
Introduction to React Native
PDF
Using JHipster for generating Angular/Spring Boot apps
PPTX
Document your rest api using swagger - Devoxx 2015
PPTX
Why you should switch to Cypress for modern web testing?
Serverless
Type script for_java_dev_jul_2020
Matheus Marsiglio - Isomorphic React + Redux App
Stripe con 2021 UI stack
“ASP.NET Core. Features and architecture”
Raphael Amorim - Scrating React Fiber
Integration and Acceptance Testing
Concurrent Rendering Adventures in React 18
Azure functions
The complete-beginners-guide-to-react dyrr
Blazor and Azure Functions - a serverless approach
Introduction to React Native
React.js - The Dawn of Virtual DOM
LONDON SDET MEETUP - Difference between Selenium and Cypress presentation
Fullstack workshop
ASP.NET Core
Introduction to React Native
Using JHipster for generating Angular/Spring Boot apps
Document your rest api using swagger - Devoxx 2015
Why you should switch to Cypress for modern web testing?
Ad

Similar to Why I am hooked on the future of React (20)

PDF
Advanced web application architecture - Talk
PPTX
O365 Developer Bootcamp NJ 2018 - Material
PDF
The Meteor Framework
PDF
Advanced web application architecture Way2Web
PPTX
Single Page Applications: Your Browser is the OS!
PPTX
Clean architecture
PPTX
Developing Lightning Components for Communities.pptx
PPTX
ReactJS - Re-rendering pages in the age of the mutable DOM
PDF
Web Development with Delphi and React - ITDevCon 2016
PPTX
Denver Salesforce Developer User Group dec 2016 lightning components
PDF
Basics of React Hooks.pptx.pdf
PPTX
Lightning web components - Introduction, component Lifecycle, Events, decorat...
PDF
Meteor + React
PPTX
Angular js 1.0-fundamentals
PPTX
ASP.NET Core Demos Part 2
PPTX
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
PPTX
PPTX
Professionalizing the Front-end
PPTX
React.js at Cortex
KEY
Architecting single-page front-end apps
Advanced web application architecture - Talk
O365 Developer Bootcamp NJ 2018 - Material
The Meteor Framework
Advanced web application architecture Way2Web
Single Page Applications: Your Browser is the OS!
Clean architecture
Developing Lightning Components for Communities.pptx
ReactJS - Re-rendering pages in the age of the mutable DOM
Web Development with Delphi and React - ITDevCon 2016
Denver Salesforce Developer User Group dec 2016 lightning components
Basics of React Hooks.pptx.pdf
Lightning web components - Introduction, component Lifecycle, Events, decorat...
Meteor + React
Angular js 1.0-fundamentals
ASP.NET Core Demos Part 2
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
Professionalizing the Front-end
React.js at Cortex
Architecting single-page front-end apps
Ad

More from Maurice De Beijer [MVP] (20)

PPTX
Full-stack App in half a Day: Next.js 15 Development Bootcamp
PPTX
Production-ready Next.js App with Cursor AI
PPTX
Building Robust Web Applications with Test-Driven Development and Playwright:...
PDF
Mastering React Server Components and Server Actions in React 19
PPTX
Practice TypeScript Techniques Building React Server Components App
PPTX
A foolproof Way to Estimate a Software Project
PPTX
Surati Tech Talks 2022 / Build reliable Svelte applications using Cypress
PPTX
Build reliable Svelte applications using Cypress
PPTX
Building reliable applications with React, C#, and Azure
PPTX
Building large and scalable mission critical applications with React
PPTX
Building Reliable Applications Using React, .NET & Azure
PPTX
Building reliable web applications using Cypress
PPTX
Getting started with React Suspense and concurrent rendering
PPTX
React suspense, not just for Alfred Hitchcock
PPTX
From zero to hero with the Reactive extensions for JavaScript
PPTX
Why I am hooked on the future of React
PPTX
The new React
PPTX
From zero to hero with the reactive extensions for JavaScript
PPTX
Why I am hooked on the future of React
PPTX
I am hooked on React
Full-stack App in half a Day: Next.js 15 Development Bootcamp
Production-ready Next.js App with Cursor AI
Building Robust Web Applications with Test-Driven Development and Playwright:...
Mastering React Server Components and Server Actions in React 19
Practice TypeScript Techniques Building React Server Components App
A foolproof Way to Estimate a Software Project
Surati Tech Talks 2022 / Build reliable Svelte applications using Cypress
Build reliable Svelte applications using Cypress
Building reliable applications with React, C#, and Azure
Building large and scalable mission critical applications with React
Building Reliable Applications Using React, .NET & Azure
Building reliable web applications using Cypress
Getting started with React Suspense and concurrent rendering
React suspense, not just for Alfred Hitchcock
From zero to hero with the Reactive extensions for JavaScript
Why I am hooked on the future of React
The new React
From zero to hero with the reactive extensions for JavaScript
Why I am hooked on the future of React
I am hooked on React

Recently uploaded (20)

DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Modernizing your data center with Dell and AMD
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Machine learning based COVID-19 study performance prediction
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
The AUB Centre for AI in Media Proposal.docx
Modernizing your data center with Dell and AMD
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Monthly Chronicles - July 2025
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Dropbox Q2 2025 Financial Results & Investor Presentation
Advanced Soft Computing BINUS July 2025.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
GamePlan Trading System Review: Professional Trader's Honest Take
Understanding_Digital_Forensics_Presentation.pptx
Unlocking AI with Model Context Protocol (MCP)
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Machine learning based COVID-19 study performance prediction
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Empathic Computing: Creating Shared Understanding
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

Why I am hooked on the future of React