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❀

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git