π React 19 Update: π Goodbye forwardRef
, Hello Simpler Ref Management! (2025) π
React 19 brings a significant update that simplifies ref handling: the ability to pass refs directly as props.
3 min read 1 day ago
React 19 brings a significant update that simplifies ref handling: the ability to pass refs directly as props. This eliminates the need for forwardRef
, a utility traditionally required to forward refs to child components in functional components.
This change is more than just a convenience β itβs a step towards cleaner, more maintainable code.
What Has Changed?
In previous versions of React, forwardRef
was used to manage refs:
import { useRef, forwardRef } from 'react'
const Input = forwardRef((props, ref) => (
<input {...props} ref={ref} />
))
export default function App() {
const inputRef = useRef()
return <Input ref={inputRef} />
}
With React 19, the
forwardRef
boilerplate can be skipped entirely and refs can be passed as regular props:
import { useRef } from 'react'
const Input = (props, ref) =>β¦