What is the difference between controlled and uncontrolled components?

Answer

1. Controlled Components:

const [value, setValue] = useState("");
return <input value={value} onChange={(e)=> setValue(e.target.value)} />;

2. Uncontrolled Components:

const inputRef = useRef(null);
return <input ref={inputRef} />;

Read more about controlled and uncontrolled components