DEV Community

Cover image for State vs Props in ReactJs
Nausher Ali
Nausher Ali

Posted on

State vs Props in ReactJs

In short:
State are the variables by the component for the component.
Props are the variables. inherited by a component from its parent components.

State and props both do the same things. there are very few differences between them such as,
Props are immutable that is it returns same output every time for a particular input.
whereas state are mutable.
state can be also defined with the help of props.
this is what i have understand till now, any type of correction will be appreciated.

Top comments (4)

devshams profile image

short and clear.

nerdyaltafofficial profile image

to the point, thanks.

nausher_ali profile image
Nausher Ali

thanks for your appreciation

techtobit profile image

Most short but Powerful complite ans❤