What is a React component?
A component is a reusable UI unit, commonly a JavaScript or TypeScript function that returns JSX.
The question library
Explore practical questions, clear explanations, and code examples across developer technologies.
Showing 3097–3108 of 3610 questions
A component is a reusable UI unit, commonly a JavaScript or TypeScript function that returns JSX.
JSX is a syntax extension that lets you describe UI with markup-like expressions in JavaScript or TypeScript.
Props are inputs from a parent; state is data managed by a component that can change over time.
The virtual DOM is an in-memory representation of UI that React reconciles to determine required updates.
Keys help React identify list items across insertions, removals, and reordering.
Conditional rendering uses JavaScript conditions to choose which UI to display.
An event handler is a function passed to props such as onClick or onChange to respond to user actions.
A controlled input gets its value from React state and updates that state through an event handler.
An uncontrolled input stores its current value in the DOM, often accessed through a ref or form submission.
useState adds local state to a function component and returns the current value and a setter.
useEffect synchronizes a component with external systems such as subscriptions, browser APIs, or network connections.
A Fragment groups multiple elements without adding an extra DOM wrapper.