Facebook Pixel

What is the difference between controlled and uncontrolled components?

Controlled components have their value controlled by React state via props. Uncontrolled components keep their state in the DOM, accessed via refs. Controlled is the React-preferred pattern for forms.

Verify This Answer

Cross-check this information using these trusted sources:

More FAQs in React Components and JSX Interview Questions With Answers

A component is a reusable, independent piece of UI described as a function that returns JSX. It accepts props, can manage its own state, and React composes many components to build full user interfaces.

Props are inputs passed from a parent to a child and are read-only inside the child. State is internal data managed by the component that can change over time and trigger re-renders.

JSX is a syntax extension for JavaScript that compiles to React.createElement calls. It lets you write UI descriptions in a markup-like style while remaining pure JavaScript that can embed expressions.

Still have questions?

Browse all our FAQs or reach out to our support team

Want to upskill yourself?

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.