What is Props and state?
The short answer
In component frameworks, props are the inputs a component receives from its parent, and state is the data a component manages itself that changes over time.
Props and state, explained
A button's label arrives as a prop; whether a menu is open is state. When either changes, the component re-renders.
Questions people ask about Props and state
What is Props and state?
In component frameworks, props are the inputs a component receives from its parent, and state is the data a component manages itself that changes over time.
Related terms
A component is a self-contained, reusable piece of interface, like a button, card or navigation bar, with its own structure, style and behaviour.
ReactReact is a JavaScript library for building user interfaces from reusable components that update automatically when their data changes.
React HooksHooks are React functions, like useState and useEffect, that let components hold state and run side effects such as fetching data or subscribing to events.
DOMThe DOM is the browser's live, tree-shaped model of a web page; JavaScript reads and changes the DOM to update what visitors see.
Part of the Web Encyclopedia by Apex Flow Digital. Definitions are general knowledge, kept current, with no invented statistics.