Users Pricing

forum

Home Forums What is the difference between state and props in React? – MindStick

What is the difference between state and props in React?

Erick Wilsom 1007 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?

1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md