adspace


When would you use a class component over a functional component?

Answer Posted / Ambuj Kumar Verma

Class components provide more features like state management, lifecycle methods, and refs. You might choose to use a class component when your component requires these advanced features or needs to access DOM directly.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How would you create higher order components (hocs) in react.js?

447


How to use events in reactjs? Give an example of using events?

559