DevAcademy

React Advanced Practice

39 questions covering 13 React topics.

Quick Quiz

1. What is unique about use() compared to hooks like useState?

2. What happens when use() is passed a Promise?

3. Where does a Promise passed to use() in a Client Component typically come from?

4. What does useOptimistic let you do?

5. What happens automatically if the underlying async action fails?

6. What kind of actions are the best fit for useOptimistic?

7. What does useActionState track automatically?

8. What arguments does the function passed to useActionState receive?

9. What is the main benefit of useActionState over manually wiring useState for pending/error?

10. What does useFormStatus let a component read?

11. What happens if useFormStatus is called in the same component that renders the <form> itself?

12. What problem does useFormStatus solve compared to manually passing a pending prop down?

13. What does the Link component do differently from a regular <a> tag?

14. Which hook reads a dynamic route parameter like :userId?

15. Which hook lets you navigate to a new route from inside an event handler?

16. What does React.memo do?

17. Why can React.memo fail to prevent a re-render even when data hasn’t "really" changed?

18. What is the purpose of list virtualization?

19. What does the fallback prop on <Suspense> render?

20. What must a component created with React.lazy be rendered inside of?

21. Does Suspense handle errors, like a failed lazy import?

22. Where does a Server Component run?

23. What directive marks a component as a Client Component?

24. Can a Client Component directly import and render a Server Component?

25. Why does the manual useEffect fetch example track a "cancelled" flag?

26. What is one benefit of a library like TanStack Query over manual fetching?

27. How can a Server Component fetch data, compared to a Client Component?

28. What does React Testing Library encourage testing?

29. Which query is generally preferred for finding elements in a test?

30. Why use findByRole instead of getByRole for content that loads asynchronously?

31. What is unique about the use() hook compared to other hooks?

32. What does useActionState provide beyond a plain async function?

33. What does useOptimistic do?

34. What problem does a state management library like Redux or Zustand typically solve?

35. What is a key difference between server state (API data) and client UI state?

36. Should every new React project start with Redux or Zustand?

37. Why avoid storing a value in state if it can be computed from existing props/state?

38. What three states should most components fetching async data handle explicitly?

39. What is a common sign that a useEffect might be unnecessary?