React and Hooks Quiz II

React and Hooks Quiz II

University

10 Qs

quiz-placeholder

Similar activities

GESTION BD

GESTION BD

University

12 Qs

React Hooks Quiz III

React Hooks Quiz III

University

8 Qs

Operating System(2)

Operating System(2)

10th Grade - University

10 Qs

Веб-куки и веб-сессии

Веб-куки и веб-сессии

University

9 Qs

M2_W2_Cloud_Computing

M2_W2_Cloud_Computing

University

15 Qs

IT13 (Quiz 3)

IT13 (Quiz 3)

University

15 Qs

W4 session 1 knowledge check

W4 session 1 knowledge check

University

10 Qs

React and Hooks Quiz II

React and Hooks Quiz II

Assessment

Quiz

Information Technology (IT)

University

Medium

Created by

Aymane Benhima

Used 5+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is React state?

An object that holds component-specific data and determines its behavior.

A function used to update a component.

A variable that is accessible globally in all components.

A method used to fetch API data.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which Hook is used to manage state in a functional component?

useState

useEffect

useRef

useContext

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which Hook is used to perform side effects in a functional component?

useEffect

useState

useReducer

useMemo

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to update state in React using useState?

setState(newValue)

this.state = newValue

useState(newValue)

updateState(newValue)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the initial render phase in React lifecycle?

The phase when a component is mounted for the first time.

The phase when a component is removed from the DOM.

The phase when a component is updated.

The phase when a component receives new props.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which lifecycle method is used for API calls in class components?

componentDidMount

componentWillUnmount

shouldComponentUpdate

componentDidUpdate

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does useEffect return if cleanup is needed?

A function that cleans up side effects when the component unmounts.

A boolean value.

A promise that resolves when cleanup is complete.

An empty object {}.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?