What is the difference between state and props?

Posted by Andre Scott | Updated on

Both props and state are plain JavaScript objects. While both of them hold information that influences the output of render, they are different in their functionality with respect to component. i.e,

1. Props get passed to the component similar to function parameters
2. state is managed within the component similar to variables declared within a function.

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers