
React and Hooks Quiz II

Quiz
•
Information Technology (IT)
•
University
•
Medium
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
Similar Resources on Wayground
10 questions
ReactJs Exercise

Quiz
•
University
13 questions
DIGITAL LITERACY

Quiz
•
12th Grade - University
15 questions
Microsoft Word Processing Skills Assessment

Quiz
•
10th Grade - University
10 questions
kuis database

Quiz
•
University
10 questions
IS Quiz

Quiz
•
University
15 questions
Module 5: Creating Dynamic Web Pages with Scripting

Quiz
•
University
15 questions
Final quiz

Quiz
•
University
15 questions
Use Cases and Domain Classes

Quiz
•
University
Popular Resources on Wayground
15 questions
Hersheys' Travels Quiz (AM)

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
30 questions
Lufkin Road Middle School Student Handbook & Policies Assessment

Quiz
•
7th Grade
20 questions
Multiplication Facts

Quiz
•
3rd Grade
17 questions
MIXED Factoring Review

Quiz
•
KG - University
10 questions
Laws of Exponents

Quiz
•
9th Grade
10 questions
Characterization

Quiz
•
3rd - 7th Grade
10 questions
Multiply Fractions

Quiz
•
6th Grade