NANDHOO
.
Learning Paths
Dashboard
Sign In
Home
Dashboard
React UI Engineering: High-Performance Architecture
Hooks & Functional Lifecycle
Quiz
Chapter Quiz: Hooks & Functional Lifecycle
Mastery Assessment: Hooks & Lifecycle
Complete this assessment with 100% score to master this chapter.
01
When exactly does the `useEffect` callback execute?
Synchronously before the DOM update.
After the browser has painted the screen.
Exactly 10ms after render.
Only when the user clicks a button.
02
What occurs if you return a function from the `useEffect` callback?
An error is thrown.
It becomes a recursive effect.
React treats it as a 'Cleanup Function' to be executed before unmounting or re-running the effect.
It renders a portal.
03
Why can't hooks be called inside conditional `if` statements?
Because it consumes too much CPU.
To ensure that React can maintain the correct hook state by calling hooks in the same order every render.
Because JavaScript doesn't support functions in conditions.
To prevent XSS attacks.
Submit Answers
Back to Lesson
Next Chapter