Categories

Mar 30 in React JS
Q: What is the difference between state and props?

1 Answer

Mar 30

The state is a data structure that starts with a default value when a

Component mounts. It may be mutated across time, mostly as a result of

user events.

Props (short for properties) are a Component’s configuration. Props are how

components talk to each other. They are received from above component

and immutable as far as the Component receiving them is concerned. A

Component cannot change its props, but it is responsible for putting together

the props of its child Components. Props do not have to just be data —

callback functions may be passed in as props.

Click here to read more about React JS
Click here to read more about Insurance

Related questions

Madanswer
May 29 in React JS
Jun 11 in C++
Sep 30, 2019 in JIRA
...