--:--









Quiz for Component Lifecycle (Class-based)

Course: REACT | Subject: React | Topic: Components



Logo

Q1: Which lifecycle method is invoked immediately after a component is mounted?

Logo

Q2: What is the primary purpose of componentDidMount()?

Logo

Q3: Which lifecycle method is called just before a component is removed from the DOM?

Logo

Q4: Which method is triggered after every update?

Logo

Q5: What are the parameters of componentDidUpdate?

Logo

Q6: Which lifecycle method is unsafe and deprecated in newer React versions?

Logo

Q7: What does componentWillUnmount typically handle?

Logo

Q8: Which method is invoked before render when new props or state are being received?

Logo

Q9: Which method can return a value to be used in componentDidUpdate?

Logo

Q10: Which lifecycle method is guaranteed to run only once?

Logo

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

Logo

Q12: What is returned from getSnapshotBeforeUpdate()?

Logo

Q13: Which of these lifecycle methods is best for making network requests?

Logo

Q14: Which method is used to clean up resources?

Logo

Q15: Where should initial AJAX calls be made in a class component?

Logo

Q16: In which method can you access previous props and state?

Logo

Q17: Which method is NOT a real lifecycle method?

Logo

Q18: What is the correct order of lifecycle methods on mount?

Logo

Q19: Which method is used to prepare the component before it mounts?

Logo

Q20: Which lifecycle method is called if shouldComponentUpdate returns false?

Are you ready to start test? Set your time limit