What is Suspense, and how does it relate to concurrent rendering?
Model answer
Suspense lets a component wait for something (lazy code, or data from a Suspense-enabled library or framework) and shows a fallback until it is ready. Concurrent rendering lets React prepare updates in the background and interrupt them if something more urgent happens, which keeps the UI responsive.
Together with transitions, you can keep the old screen visible instead of flashing a loading state.
Learn this topic
React Performance: memo, useMemo, useCallback and When Not to Use Them in the course React.js Full Course: Beginner to Advanced.
Sign in to add your own answer.
More questions
- Why does a component re-render, and is re-rendering always bad?
- What does React.memo do?
- What is the difference between useMemo and useCallback?
- What is the React Compiler, and does it replace useMemo and useCallback?
- How do you lazy-load components in React?
- How do you render a very long list efficiently?