React Hooks Quiz III

React Hooks Quiz III

University

8 Qs

quiz-placeholder

Similar activities

Android Eğitim

Android Eğitim

University

10 Qs

Globalization and State Sovereignty Quiz

Globalization and State Sovereignty Quiz

University

10 Qs

IT Quiz Bee 2025 - DIFFICULT

IT Quiz Bee 2025 - DIFFICULT

University

10 Qs

🎮 Technology Addiction Quiz

🎮 Technology Addiction Quiz

University

10 Qs

Quiz Mobile Dev

Quiz Mobile Dev

University

13 Qs

Introduction & Basic Program Structure

Introduction & Basic Program Structure

University

10 Qs

Web aplikacije - uvodne vježbe

Web aplikacije - uvodne vježbe

University

12 Qs

DSA-Quiz1-Pointers

DSA-Quiz1-Pointers

University

10 Qs

React Hooks Quiz III

React Hooks Quiz III

Assessment

Quiz

Information Technology (IT)

University

Hard

Created by

Aymane Benhima

FREE Resource

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which Hook is used to store and update state in functional components?

useState

useEffect

useRef

useContext

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to initialize state using useState?

const [count, setCount] = useState(0);

const count = useState(0);

const [count] = useState(0);

const [count, updateCount] = useState();

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will happen if useEffect is missing the dependency array?

The effect will run after every render.

The effect will never run.

The effect will run only once.

React will throw an error.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a common mistake when using useEffect with dependencies?

Not including all necessary dependencies in the array.

Using useEffect inside event handlers.

Using useState inside useEffect.

Calling setState directly inside the render function.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you clean up a side effect in useEffect?

Return a cleanup function inside useEffect.

Call useEffect twice.

Use useMemo instead of useEffect.

Set useEffect dependencies to null.

6.

OPEN ENDED QUESTION

3 mins • 1 pt

Media Image

What is wrong with the following useState usage?

Evaluate responses using AI:

OFF

7.

OPEN ENDED QUESTION

3 mins • 1 pt

Media Image

What is wrong with this useEffect implementation?

Evaluate responses using AI:

OFF

8.

OPEN ENDED QUESTION

3 mins • 1 pt

Media Image

Find the mistake in this Custom Hook implementation:

Evaluate responses using AI:

OFF