W3
Teacher
Explore
Browse by field
Artificial Intelligence
Accounting & Finance
Information Technology
Show all fields
Interview Q&A
All Interview Questions
Beginner
Intermediate
Advanced
Practice
MCQs
Quizzes
Mock Interviews
About
Light
Dark
Auto
Sign in
Get Started
Search interview questions
Search
7 questions for “Class Components & Legacy Lifecycle Methods”
Found in 1 field. Select a question to see its full answer.
Matching topics
React
Class
Components
&
Legacy
Lifecycle
Methods
5
Information Technology
7 questions in 1 technology
#
Question
Technology
Topic
Level
1
Why can only
class
components
be used as error boundaries in React?
React › Class Components & Legacy Lifecycle Methods
React
Class
Components
&
Legacy
Lifecycle
Methods
Intermediate
2
How do you set and update state correctly inside a
class
component?
React › Class Components & Legacy Lifecycle Methods
React
Class
Components
&
Legacy
Lifecycle
Methods
Beginner
3
What does componentDidMount do in a
class
component and what is its equivalent using hooks?
React › Class Components & Legacy Lifecycle Methods
React
Class
Components
&
Legacy
Lifecycle
Methods
Intermediate
4
What is a
class
component in React and how does it differ from a function component?
React › Class Components & Legacy Lifecycle Methods
React
Class
Components
&
Legacy
Lifecycle
Methods
Beginner
5
What is componentDidUpdate used for, and what mistake should you watch out for when using it?
React › Class Components & Legacy Lifecycle Methods
React
Class
Components
&
Legacy
Lifecycle
Methods
Advanced
6
What is an error boundary in React and why is it useful?
React › Error Boundaries
React
Error Boundaries
Beginner
7
What is the difference between a ref created with useRef and one created with createRef?
React › Refs, useRef & forwardRef
React
Refs, useRef & forwardRef
Beginner