React and Hooks Quiz II

React and Hooks Quiz II

University

10 Qs

quiz-placeholder

Similar activities

issues and challenges of it

issues and challenges of it

University

5 Qs

DFC20283 CHAPTER 5 (5.1.6-5.1.9)

DFC20283 CHAPTER 5 (5.1.6-5.1.9)

University

10 Qs

React Tutorial Quiz

React Tutorial Quiz

University

15 Qs

Unit: IV MongoDB and Node.js Quiz

Unit: IV MongoDB and Node.js Quiz

12th Grade - University

14 Qs

POST-TEST

POST-TEST

University

15 Qs

The Linux Vault

The Linux Vault

University

15 Qs

LibreOffice Writer Styles Quiz

LibreOffice Writer Styles Quiz

10th Grade - University

15 Qs

UML and System Modeling Quiz

UML and System Modeling Quiz

12th Grade - University

15 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?

Discover more resources for Information Technology (IT)