Loading

Quipoin Menu

Learn • Practice • Grow

react / Loading and Error States
mcq
Direction: Choose the correct option

Q1.

How do you typically display a loading indicator in React?
A. Use a loading attribute
B. Use a built-in loading component
C. The browser shows a loading bar
D. Conditionally render a spinner based on a loading state
Direction: Choose the correct option

Q2.

What is a common pattern for handling errors from API calls?
A. Log to console only
B. Throw the error and let it crash
C. Ignore errors
D. Set an error state and display a message if error exists
Direction: Choose the correct option

Q3.

Given a fetch request, where should you set loading to false?
A. In both .then() and .catch()
B. Only in .catch()
C. Only in .then()
D. In the finally block
Direction: Choose the correct option

Q4.

How can you show a retry button after an error?
A. Errors automatically retry
B. Include a button that re-triggers the fetch
C. It's not possible
D. Use a refresh hook
Direction: Choose the correct option

Q5.

What is a skeleton screen?
A. A loading spinner
B. A blank screen
C. An error message
D. A placeholder UI that mimics the layout while content loads