ReactJS State Vs Props
ReactJS State Vs Props
Props
Props are read-only components. It is an object which stores the value of attributes of a tag and
work similar to the HTML attributes. It allows passing data from one component to other
components. It is similar to function arguments and can be passed to the component the same way
as arguments passed in a function. Props are immutable so we cannot modify the props from
inside the component.
SN Props State
3. Props allow you to pass data from one State holds information about the
component to other components as an components.
argument.
5. Props are used to communicate between States can be used for rendering
components. dynamic changes with the
component.
https://www.javatpoint.com/react-state-vs-props 1/2
7/31/22, 3:14 PM ReactJS State Vs Props - javatpoint
8. Props are external and controlled by whatever The State is internal and controlled
renders the component. by the React Component itself.
The below table will guide you about the changing in props and state.
Note: The component State and Props share some common similarities. They are given in the
below table.
https://www.javatpoint.com/react-state-vs-props 2/2