What is the difference between state and props in react js?



What is the difference between state and props in react js?..

Answer / Vaishali Vishnoi

{"state": "In React, the state is a data structure that stores the local state of a component. It can be mutated only by calling setState().",n"props": "Props (short for properties) are used to customize components. They are read-only and cannot be modified from within the component itself. Props are passed down through the component tree from a parent to a child."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More React.js Interview Questions

What do you understand by “single source of truth”?

1 Answers  


How to add google analytics for react router?

1 Answers  


What are refs in reactjs? When to use it.

1 Answers  


What is a router in react.js?

1 Answers  


What are the life cycle of reactjs?

1 Answers  


What is REFS in React

1 Answers  


Explain the components of Redux?

1 Answers  


How can we do server-side rendering in React?

1 Answers  


What is the purpose of render() in react?

1 Answers  


What is a state in reactjs and how is it used?

1 Answers  


How events are different in react?

1 Answers  


What are pure functional components?

1 Answers  


Categories