From the course: Build Modern Web Apps with React, Hooks, State Management, and APIs Using Vite or Next.js
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Performance considerations
From the course: Build Modern Web Apps with React, Hooks, State Management, and APIs Using Vite or Next.js
Performance considerations
Welcome back. In this video, we are going to see the performance considerations for optimization. The first thing to notice is that whatever we are going to put inside our context and on update on that context value, all the consumers that are reading from that context value are going to get a re-render. So we should be careful of what we are putting inside our context and how many consumers are we having with that. With a mismatch of calculation, with putting things inside our context and having maximum numbers of consumers reading from that context value can result in a large number of re-rendering on your website, which can slow your website down and it can decrease the performance. So while creating a context, you should be considering to keep minimum numbers of consumers and only the ones that actually need to read from that value. To avoid the impact, we can use the use memo hook to stabilize the value reads. As we know that the use memo hook can memorize a value which is not…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Introduction and recap: Local state and global state7m 6s
-
(Locked)
useState and useContext: Recap and pitfalls5m 56s
-
(Locked)
Problems solved by global state libraries7m 26s
-
(Locked)
Problems without global state: Summary5m 13s
-
(Locked)
Lifting state up: Recap3m 17s
-
(Locked)
Advanced scenario 1: Multiple dependents6m 46s
-
(Locked)
Advanced scenario 2: Derived state8m 14s
-
(Locked)
Summary2m 8s
-
(Locked)
Context API: Recap4m 48s
-
(Locked)
Best practices2m 48s
-
(Locked)
Performance considerations3m 35s
-
(Locked)
Introduction to Redux5m 6s
-
(Locked)
Setting up Redux project4m 17s
-
(Locked)
Setting up types for action6m 1s
-
(Locked)
Setting up actions for counter6m 18s
-
(Locked)
Setting up reducer for counter6m 52s
-
(Locked)
Setting up Redux store8m 20s
-
(Locked)
Counter component11m 50s
-
(Locked)
Introduction to RTK2m 29s
-
(Locked)
Real-world analogy: Key concepts3m 58s
-
(Locked)
Store setup14m 36s
-
(Locked)
Reducer setup8m 25s
-
(Locked)
Custom hook and component setup11m 4s
-
(Locked)
Plug new store and dev tools demo5m 51s
-
(Locked)
Introduction to async thunk in RTK2m 44s
-
(Locked)
Explanation of code with async thunk and slice5m 8s
-
(Locked)
Fetch users function11m 7s
-
(Locked)
User slice setup7m 19s
-
(Locked)
Users component and demo8m 25s
-
(Locked)
RTK Query: Introduction2m 50s
-
(Locked)
Reselect usage and demo7m 37s
-
(Locked)
Caching and refetching comparison6m 41s
-
(Locked)
useSelector problems7m 22s
-
(Locked)
Generated hooks and example7m 8s
-
(Locked)
Benefits of Reselect1m 39s
-
(Locked)
Custom middleware: Introduction8m 15s
-
(Locked)
Analytic middleware example2m 19s
-
(Locked)
Benefits and summary1m 31s
-
(Locked)
Challenges with large apps2m 42s
-
(Locked)
Domain-based example2m 24s
-
(Locked)
Benefits of structured stores1m 58s
-
(Locked)
Redux alternatives3m 44s
-
(Locked)
Zustand code example8m 15s
-
(Locked)
Jotai code example11m 41s
-
(Locked)
Recoil code example14m 39s
-
(Locked)
Comparison: When to use which3m 17s
-
(Locked)
Introduction to server state management4m 28s
-
(Locked)
TanStack React Query example4m 25s
-
(Locked)
SWR (Stale-While-Revalidate) example3m 18s
-
(Locked)
Comparison between TanStack and SWR4m 34s
-
(Locked)
Project overview6m 27s
-
(Locked)
Project setup and installations5m 13s
-
(Locked)
Store setup and API5m 31s
-
(Locked)
Products list component6m 52s
-
(Locked)
Product card component7m 49s
-
(Locked)
Cart slice8m 48s
-
(Locked)
Cart component19m 5s
-
(Locked)
App component6m 50s
-
(Locked)
Server-side sync5m 12s
-
(Locked)
-