← BYTES
React.js·Starter·Ref: 4.1.6
What is the difference between a controlled and an uncontrolled input in React?
Have a question about this video? Mention reference 4.1.6 when you contact us.
a.Controlled inputs can only be used inside class components
b.Uncontrolled inputs cannot have an onChange handler at all
c.A controlled input's value is driven by React state; an uncontrolled input manages its own value internally and is read via a ref
d.There is no real difference, the terms are interchangeable
A controlled input's displayed value always comes from a React state variable (updated via onChange), making React the single source of truth. An uncontrolled input lets the DOM itself hold the current value, which you read out on demand (e.g. via a ref) rather than tracking on every keystroke.
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES416#Reactjs