React - State v/s Props

Props and state are used to store dynamic information in react. Dynamic information can change, by definition. But there is a difference.

A React component should use props to store information that can be changed, but can only be changed by a different component.

A React component should use the state to store information that the component itself can change.

Comments

Popular posts from this blog

Inserting and Moving elements inside Ruby Array

Interview Question on Ruby on Rails