This guide will analyze the primary role of props in a React.js component, how it is different from state, and when to use it over state. This will be done by seeing how props values are changed within a component as well as how they can be used to update the state of an external component.

Developers sometimes interchange props and state as both can be accessed via the instance of a component and hold data. However, if a component needs to maintain data independent of external components calling it, then state should be used. If a component needs to render data and invoke functions from another component, those data should be passed through props.

#react #javascript

Change Props in Stateless React.js Components through Parent Functions
2.20 GEEK