Custom Hooks Quiz
Test your knowledge of custom Hooks in React, including naming, extraction, dependencies, reusable logic, and common pitfalls.
20 questions · free · answers explained
All questions in this quiz
- What is a custom Hook in React?
- How should a custom Hook name begin?
- Why does the use prefix matter for custom Hooks?
- Can a custom Hook call built-in Hooks like useState and useEffect?
- What do custom Hooks share between components?
- If two components call the same custom Hook, what happens to their state?
- When is it usually a good idea to extract a custom Hook?
- What should a custom Hook usually return?
- Which custom Hook name is most appropriate for tracking online status?
- Should a regular utility function that does not call Hooks start with use?
- Can custom Hooks accept arguments?
- What should happen to reactive values used inside a custom Hook effect?
- Why should custom Hooks remain pure during render?
- What is a drawback of vague custom Hooks like useMount?
- Which custom Hook name best describes connecting to a chat room?
- Can a custom Hook call another custom Hook?
- Where may a custom Hook be called?
- What is a common benefit of extracting a custom Hook?
- What does useDebugValue help with in custom Hooks?
- What is the best sign that a custom Hook API is too abstract?
Prefer to read first? React interview questions with written answers.