When should you use the top-class elements for the function element?



When should you use the top-class elements for the function element?..

Answer / Pradip Kumar Srivastava

Top-level class components (es6 classes extending React.Component) are preferred when you need to access or manipulate lifecycle methods, such as componentDidMount, componentDidUpdate, and componentWillUnmount.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More React.js Interview Questions

How is react.js different from other javascript frameworks?

1 Answers  


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

1 Answers  


Explain the major advantages of react.

1 Answers  


What's the difference between super() and super(props) in React when using ES6 classes?

1 Answers  


What do you understand with the term polling?

1 Answers  


What is high-level component lifecycle in react.js?

1 Answers  


What is react fiber?

1 Answers  


Explain strict mode

1 Answers  


What is a router in react.js?

1 Answers  


What is the difference between stateful and stateless components.

1 Answers  


How is react router different from conventional routing?

1 Answers  


Is react a mvc framework?

1 Answers  


Categories