useSyncExternalStore Quiz
Test your knowledge of the useSyncExternalStore Hook in React, including external subscriptions, snapshots, server rendering, and store integration.
20 questions · free · answers explained
All questions in this quiz
- What is useSyncExternalStore used for?
- Which two functions are required by useSyncExternalStore?
- What should the subscribe function do?
- What should getSnapshot return?
- Why must getSnapshot return a cached value when the store has not changed?
- What is the optional third argument to useSyncExternalStore for?
- What kind of source is a good fit for useSyncExternalStore?
- What is a common browser API example for useSyncExternalStore?
- When does React call getSnapshot?
- What should happen when the external store changes?
- Why is useSyncExternalStore useful for library authors?
- What should getSnapshot avoid doing?
- What happens if subscribe is defined inside a component without memoization?
- What does useSyncExternalStore return to the component?
- Which issue can useSyncExternalStore help prevent?
- Should useSyncExternalStore replace useState for normal local component state?
- What should getServerSnapshot return during hydration?
- Which comparison does React use for snapshot changes?
- What is a practical pattern for mutable external stores?
- What is the main responsibility of useSyncExternalStore?
Prefer to read first? React interview questions with written answers.