React and Hooks Quiz II

React and Hooks Quiz II

University

10 Qs

quiz-placeholder

Similar activities

10 ARTIFICIAL INTELLIGENCE

10 ARTIFICIAL INTELLIGENCE

10th Grade - University

10 Qs

Base de Datos I - Parte 1

Base de Datos I - Parte 1

University

10 Qs

Codean | TypeScript dan React

Codean | TypeScript dan React

University

10 Qs

Use Cases and  Domain Classes

Use Cases and Domain Classes

University

15 Qs

DIGITAL LITERACY

DIGITAL LITERACY

12th Grade - University

13 Qs

Вопросы по C# от Naviuki

Вопросы по C# от Naviuki

University

12 Qs

Computer Programming I Finals

Computer Programming I Finals

University

11 Qs

Final quiz

Final quiz

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?