Props and state are related. The state of one component will often become the props of a child component. Props are passed to the child within the render method of the parent as the second argument to React.createElement() or, if you're using JSX, the more familiar tag attributes.

<MyChild name={this.state.childsName} />

The parent's state value of childsName becomes the child's this.props.name. From the child's perspective, the name prop is immutable. If it needs to be changed, the parent should just change its internal state:

this.setState({ childsName: 'New name' });

and React will propagate it to the child for you. A natural follow-on question is: what if the child needs to change its name prop? This is usually done through child events and parent callbacks. The child might expose an event called, for example, onNameChanged. The parent would then subscribe to the event by passing a callback handler.

<MyChild name={this.state.childsName} onNameChanged={this.handleName} />

The child would pass its requested new name as an argument to the event callback by calling, e.g., this.props.onNameChanged('New name'), and the parent would use the name in the event handler to update its state.

handleName: function(newName) {
   this.setState({ childsName: newName });
}
Answer from Todd on Stack Overflow
Top answer
1 of 16
849

Props and state are related. The state of one component will often become the props of a child component. Props are passed to the child within the render method of the parent as the second argument to React.createElement() or, if you're using JSX, the more familiar tag attributes.

<MyChild name={this.state.childsName} />

The parent's state value of childsName becomes the child's this.props.name. From the child's perspective, the name prop is immutable. If it needs to be changed, the parent should just change its internal state:

this.setState({ childsName: 'New name' });

and React will propagate it to the child for you. A natural follow-on question is: what if the child needs to change its name prop? This is usually done through child events and parent callbacks. The child might expose an event called, for example, onNameChanged. The parent would then subscribe to the event by passing a callback handler.

<MyChild name={this.state.childsName} onNameChanged={this.handleName} />

The child would pass its requested new name as an argument to the event callback by calling, e.g., this.props.onNameChanged('New name'), and the parent would use the name in the event handler to update its state.

handleName: function(newName) {
   this.setState({ childsName: newName });
}
2 of 16
275

For parent-child communication, simply pass props.

Use state to store the data your current page needs in your controller-view.

Use props to pass data & event handlers down to your child components.

These lists should help guide you when working with data in your components.

Props

  • are immutable
    • which lets React do fast reference checks
  • are used to pass data down from your view-controller
    • your top level component
  • have better performance
    • use this to pass data to child components

State

  • should be managed in your view-controller
    • your top level component
  • is mutable
  • has worse performance
  • should not be accessed from child components
    • pass it down with props instead

For communication between two components that don't have a parent-child relationship, you can set up your own global event system. Subscribe to events in componentDidMount(), unsubscribe in componentWillUnmount(), and call setState() when you receive an event. Flux pattern is one of the possible ways to arrange this. - https://facebook.github.io/react/tips/communicate-between-components.html

What Components Should Have State?

Most of your components should simply take some data from props and render it. However, sometimes you need to respond to user input, a server request or the passage of time. For this you use state.

Try to keep as many of your components as possible stateless. By doing this you'll isolate the state to its most logical place and minimize redundancy, making it easier to reason about your application.

A common pattern is to create several stateless components that just render data, and have a stateful component above them in the hierarchy that passes its state to its children via props. The stateful component encapsulates all of the interaction logic, while the stateless components take care of rendering data in a declarative way. - https://facebook.github.io/react/docs/interactivity-and-dynamic-uis.html#what-components-should-have-state

What Should Go in State?

State should contain data that a component's event handlers may change to trigger a UI update. In real apps this data tends to be very small and JSON-serializable. When building a stateful component, think about the minimal possible representation of its state, and only store those properties in this.state. Inside of render() simply compute any other information you need based on this state. You'll find that thinking about and writing applications in this way tends to lead to the most correct application, since adding redundant or computed values to state means that you need to explicitly keep them in sync rather than rely on React computing them for you. - https://facebook.github.io/react/docs/interactivity-and-dynamic-uis.html#what-should-go-in-state

🌐
React
legacy.reactjs.org › docs › faq-state.html
Component State – React
While both hold information that ... way: props get passed to the component (similar to function parameters) whereas state is managed within the component (similar to variables declared within a function)....
Discussions

why is "props to state" an anti-pattern in ReactJS?
I read somewhere when using react that when passing objects to components, setting them as the component's state in the… More on reddit.com
🌐 r/javascript
36
28
February 10, 2017
State vs. Props and how to stop confusing them?
Props are passed to the component, so they are external data that usually comes from another component that renders it. State, on the other hand, is internal to a component and is usually managed by it. State from one component can be passed to another component via its props, much like a function could call another function and give it arguments. Define props for a component when you want it receive data from whoever will render it. Use state in a component when you want to have control over some piece of data that it will manage/update. More on reddit.com
🌐 r/reactjs
5
2
September 21, 2019
I had an interview question: what is the difference between state be props and when would you use which?
I doubt it's a trick, but different perspectives and experience levels could make it hard to answer in the way they're expecting. Looking at a single interactive component, it gets props passed in as values from the parent component and establishes its own state internally. The component will rerender if either its props or its state change. This is often how React is taught, along with guidance about moving state up the component tree if you need it in multiple components. Looking at a larger application, props are a little bit fake. The reason props and state behave so similarly in the single component view is because the props are just state from higher up the component tree. Component libraries often use this to make it easy to fit into any app, regardless of how that app is managing its state. If I ask this question in an interview, I'm probably expecting most candidates to answer from a single component perspective. It's pretty basic knowledge that I can use to establish a baseline of their React experience. If you start from a different perspective, or have strong opinions about how components use state, your answer will have to work harder to establish that same baseline. More on reddit.com
🌐 r/reactjs
6
0
March 1, 2023
Tampermonkey and React.JS
I've never used tampermonkey, but I'm guessing the document idle event and react are probably not connected in any way. It's probably when the browser is done loading and processing the html page (which is also when react would start the render process). So you are probably right that the email input hasn't been rendered yet. Might be a bit hacky but you could try setting a global variable and then loading that in your react component. Is there no way to access tampermonkey from the react component? More on reddit.com
🌐 r/javascript
8
6
May 10, 2016
🌐
GeeksforGeeks
geeksforgeeks.org › reactjs › reactjs-state-vs-props
ReactJS State vs Props - GeeksforGeeks
Unlike state, props are immutable, meaning they cannot be modified within the receiving component. Props allow components to be reusable and dynamic. Props are read-only and cannot be changed by the child component.
Published   August 5, 2025
🌐
freeCodeCamp
freecodecamp.org › news › react-js-for-beginners-props-state-explained
React.js for Beginners — Props and State Explained
February 10, 2020 - const ChildComponent = (props) => { // statements }; And finally, we use dot notation to access the prop data and render it: ... React has another special built-in object called state, which allows components to create and manage their own data.
🌐
Medium
medium.com › @techathoncert › props-and-state-in-react-c2bc30986b10
Props and State in React. In React, both props (properties) and… | by Techthon | Medium
November 24, 2023 - Both props and state play crucial roles in React applications. Props facilitate the flow of data from parent to child components, while state allows components to manage and update their internal data.
🌐
React
legacy.reactjs.org › docs › components-and-props.html
Components and Props – React
To learn more about the reasoning behind this convention, please read JSX In Depth. Components can refer to other components in their output. This lets us use the same component abstraction for any level of detail. A button, a form, a dialog, a screen: in React apps, all those are commonly expressed as components. For example, we can create an App component that renders Welcome many times: function Welcome(props) { return <h1>Hello, {props.name}</h1>; } function App() { return ( <div> <Welcome name="Sara" /> <Welcome name="Cahal" /> <Welcome name="Edite" /> </div> ); }
🌐
Simplilearn
simplilearn.com › home › resources › software development › learn react tutorial with real-world projects › reactjs state: setstate, props and state explained
ReactJS State: SetState, Props and State Explained [Updated]
June 9, 2025 - This article explains the ReactJS state, setstate method, and state vs props. ReactJS is a popular front end JavaScript library, so click here to learn more about ReactJS.
Address   5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
Find elsewhere
🌐
Javatpoint
javatpoint.com › react-state-vs-props
ReactJS State Vs Props - javatpoint
Hooks are the functions which "hook into" React state and lifecycle features from function components.
🌐
DEV Community
dev.to › highflyer910 › react-props-vs-state-whats-the-difference-4e3i
React Props vs State: What's the Difference? - DEV Community
September 25, 2023 - In summary, props and state are both important concepts in React. Props are used to pass data from parent to child components, while state is used to manage data that can change over time within a component.
🌐
Codedamn
codedamn.com › news › react js
What is the difference between props and state in React?
October 9, 2023 - In conclusion, while both props ... crucial. Remember, props are all about receiving data from parents and ensuring a one-way data flow, while state is about managing local, mutable data within a component....
🌐
GeeksforGeeks
geeksforgeeks.org › reactjs › what-are-the-differences-between-props-and-state
What are the differences between props and state ? - GeeksforGeeks
July 23, 2025 - In React JS, the main difference between props and state is that the props are a way to pass the data or properties from one component to other components while the state is the real-time data available to use within only that component.
🌐
LinkedIn
linkedin.com › pulse › understanding-difference-between-props-state-react-basit-ch
Understanding the Difference Between Props and State in React
February 22, 2023 - ... In this example, we have a ... World!" to the message prop when it renders the ChildComponent. ... State represents the internal state of a component....
🌐
LinkedIn
linkedin.com › pulse › state-vs-props-react-whats-difference-mohammad-shoeb-faizan
State vs Props in React: What's the Difference?
May 11, 2023 - In React, props (short form for "properties") are used to pass data from a parent component to a child component. Props are read-only, and a child component cannot modify the props it receives from its parent.
🌐
Lucybain
lucybain.com › blog › 2016 › react-state-vs-pros
ReactJS: Props vs. State - Lucy Bain
The component renders, with “Clicked 1 times” as the button text · While props and state both hold information relating to the component, they are used differently and should be kept separate.
🌐
CRS Info Solutions
crsinfosolutions.com › home › props and state in react with examples
Props and State in React with Examples
Salesforce Training
Understanding props and state is crucial for mastering React.js. Props allow components to interact and share data in a unidirectional flow, while state enables them to maintain and update their data. I have enrolled for Salesforce Admin and development online course at CRS info solutions. It’s really the best training i have ever taken and syllabus is highly professional
Rating: 5 ​
🌐
DhiWise
dhiwise.com › post › state-and-props-the-pillars-of-react-explained
Understanding Foundations: React State and Props ...
August 20, 2024 - In React, props (short for properties) are values passed from a parent component to a child component. They allow components to communicate with each other. Unlike state, props are read-only and cannot be modified by the child component.
🌐
React
react.dev › learn › passing-props-to-a-component
Passing Props to a Component – React
Don’t try to “change props”. ... you can learn about in State: A Component’s Memory. To pass props, add them to the JSX, just like you would with HTML attributes....
🌐
Medium
medium.com › @PavanCodeCraft › react-js-a-comprehensive-guide-to-state-and-props-48589fb1615d
React JS: A Comprehensive Guide to State and Props | by PAVAN BIRARI | Medium
February 1, 2024 - Show or hide content: You can use state to show or hide content based on user interaction. What are props ? Props are read-only values that can be passed across components in order to display relevant data in your React apps.
🌐
Flatlogic
flatlogic.com › blog › what is the difference between state and props in react?
What is The Difference Between State and Props in React? - Flatlogic Blog
April 14, 2023 - Enjoy reading! Props are a JavaScript object that React components receive as an arbitrary input to produce a React element. They provide a data flow between the components. To pass the data (props) from one component to another as a parameter: ...
🌐
Medium
medium.com › @itIsMadhavan › reactjs-props-vs-state-ff3a7680930d
ReactJS: Props vs. State - by Madhavan Nagarajan
November 25, 2019 - Since props are passed in, and they cannot change, you can think of any React component that only uses props (and not state) as “pure,” that is, it will always render the same output given the same input.