D. revalidator is a hook object, not a function; should call revalidator.revalidate()
Solution
Step 1: Check how revalidator is used
revalidator is the object returned by useRevalidator hook, not a function itself.
Step 2: Correct method to call
To trigger revalidation, call revalidator.revalidate(), not revalidator().
Final Answer:
revalidator is a hook object, not a function; should call revalidator.revalidate() -> Option D
Quick Check:
revalidator.revalidate(), not revalidator() = A [OK]
Hint: Call revalidator.revalidate(), not revalidator() [OK]
Common Mistakes:
Calling revalidator() instead of revalidator.revalidate()
Using wrong HTTP method for mutation
Thinking revalidate must be awaited
5. You have a form that updates user info and calls an API mutation. You want the UI to show the updated user data immediately after submission without a full page reload. Which approach correctly uses Remix revalidation after mutation?
hard
A. Use setTimeout to delay UI update by 2 seconds
B. After the mutation fetch call, call revalidator.revalidate() from useRevalidator hook
C. Do nothing; Remix automatically updates UI after mutation
D. Reload the entire page using window.location.reload() after mutation
Solution
Step 1: Understand Remix's data update behavior
Remix does not auto-refresh UI after mutations; manual revalidation is needed.
Step 2: Use useRevalidator hook to refresh data
Calling revalidator.revalidate() after mutation triggers UI update without full reload.
Final Answer:
After the mutation fetch call, call revalidator.revalidate() from useRevalidator hook -> Option B
Quick Check:
Manual revalidate() call updates UI after mutation = D [OK]
Hint: Call revalidate() after mutation to update UI without reload [OK]
Common Mistakes:
Relying on automatic UI update without revalidate()
Reloading whole page instead of revalidating
Using delays instead of proper revalidation
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.