Question 10 of 10Pro Only
How do you test custom React hooks? What are the best practices for testing asynchronous code?
Sample answer preview
Testing custom hooks and asynchronous code requires specific techniques to handle React's lifecycle and Promises. To test a custom hook, use renderHook from React Testing Library.
renderHookactwaitForrerendercustom hooksasync testing