Loading

Quipoin Menu

Learn • Practice • Grow

react / Conditional Rendering in React
mcq
Direction: Choose the correct option

Q1.

What is conditional rendering in React?
A. Rendering components based on certain conditions
B. Rendering only on weekends
C. Using if statements inside JSX
Direction: Choose the correct option

Q2.

Which of the following is a valid way to conditionally render in JSX?
A. Using if/else inside JSX
B. Using ternary operator
C. Both B and C
D. Using && operator
Direction: Choose the correct option

Q3.

What does {isLoggedIn && } do if isLoggedIn is false?
A. Renders LogoutButton
B. Renders false
C. Throws an error
D. Renders nothing
Direction: Choose the correct option

Q4.

Which statement about conditional rendering is true?
A. You must use a ternary for every condition
B. You cannot use else inside JSX
C. Conditional rendering only works with state
D. It's better to use multiple return statements
Direction: Choose the correct option
A. Both
B. Nothing
C. <B />
D. <A />