Users Pricing

forum

home / developersection / forums / what is the difference between state and props in react?

What is the difference between state and props in React?

Erick Wilsom 939 27 Oct 2022

What is the difference between state and props in React?

Both props and state changes trigger a render update.

Props (short for properties) are a Component's configuration, its options if you may. They are received from above and immutable.
  • So props can change but they should be immutable?
  • When should you use props and when should you use state?
  • If you have data that a React component needs, should it be passed through props or setup in the React component via getInitialState?

Erick Wilsom

student

Writing is my profession! I have written hundreds of article for many organizations and looking forward to work with growing organization. I am compatible to produce content in many categories including International politics, Healthcare, Education, Lifestyle, etc.. I understand the value of your time that you have invested to read my bio. #thanks


1 Answers