DEV Community

Discussion on: Explain State and Props Like I'm Five

Collapse
 
luispa profile image
LuisPa

Imagin state as a JavaScript object.

State comes from inside the parent or inside the children, and can be traspased to another children as a prop. You can only change the state inside the creator of the state.

Props comes from the parent to the children. The children can’t change the prop (it’s read only).