Loading

Quipoin Menu

Learn • Practice • Grow

react / Functional Components in React
mcq
Direction: Choose the correct option

Q1.

What is a functional component in React?
A. A component defined as a JavaScript function that returns JSX
B. A component that must have state
C. A component that uses only class syntax
D. A component that cannot accept props
Direction: Choose the correct option

Q2.

Before hooks, what was a limitation of functional components?
A. They could not return JSX
B. They required a render() method
C. They could not use state or lifecycle features
D. They were slower than class components
Direction: Choose the correct option

Q3.

Which hook allows functional components to manage state?
A. useReducer
B. useEffect
C. useState
D. useContext
Direction: Choose the correct option

Q4.

How do you pass props to a functional component?
A. Via the 'props' property
B. Via the function's first argument
C. Via global variables
D. Via the 'this.props' object
Direction: Choose the correct option

Q5.

What will the following functional component render?
function Greet() { return 

Hello

; }
A. undefined
B. Hello
C. Nothing, missing export
D. <h1>Hello</h1>