A controlled component is one where form data is handled by React state.
const [value, setValue] = useState("");<input value={value} onChange={e => setValue(e.target.value)} />
An uncontrolled component lets the DOM handle its own state.
const inputRef = useRef();<input ref={inputRef} />
A Pure Component renders the same output when given the same props and state. Use Pure Components to improve performance by avoiding redundant rendering.
const MyComponent = React.memo(function MyComponent(props) {return <div>{props.name}</div>;});
A Higher-Order Component (HOC) is a function that takes a component and returns a new component with enhanced behavior.
const withLogger = (WrappedComponent) => {return (props) => {console.log("Rendering", WrappedComponent.name);return <WrappedComponent {...props} />;};};