Skip to content
Daily Dev Tip

This tip lives in your new tab — for free.

Install for Chrome →
REACT

Drop forwardRef in React 19 and accept ref as a normal prop

app/components/Input.tsx
tsx
function Input({
  ref,
  ...props
}: React.ComponentPropsWithRef<'input'>) {
  return <input ref={ref} {...props} />
}

// no forwardRef wrapper needed
<Input ref={inputRef} placeholder="Email" />

React 19 lets function components receive `ref` as a regular prop, so `forwardRef` is no longer required for the common case of exposing a DOM node. Fewer wrappers means cleaner component types and less indirection. `forwardRef` still works for backward compatibility, but new components should just declare `ref` in props. Use `React.ComponentPropsWithRef` to type the forwarded element's props correctly.

react19refscomponentsapi