--:--









Quiz for Class Components

Course: REACT | Subject: React | Topic: Components



Logo

Q1: What keyword is used to create a class component in React?

Logo

Q2: What must a class component extend to become a React component?

Logo

Q3: Which method is mandatory in a React class component?

Logo

Q4: How do you pass props in a class component?

Logo

Q5: Where should state be initialized in a class component?

Logo

Q6: What is the correct syntax to define state in constructor?

Logo

Q7: Which method is used to update the state?

Logo

Q8: Which lifecycle method is called after a component is rendered?

Logo

Q9: Which lifecycle method is called before unmounting?

Logo

Q10: How do you bind "this" in a class component?

Logo

Q11: Which method determines if a component should re-render?

Logo

Q12: What is returned by the render() method?

Logo

Q13: What is the default behavior of setState()?

Logo

Q14: How can state be passed from parent to child?

Logo

Q15: Which method is used to perform side-effects in class components?

Logo

Q16: Which keyword is used to inherit in a class component?

Logo

Q17: What will happen if render() returns undefined?

Logo

Q18: How many render methods can a class component have?

Logo

Q19: What is the purpose of constructor in class components?

Logo

Q20: Which keyword is used to call the parent class constructor?

Are you ready to start test? Set your time limit