Rules
no-forward-ref
Full Name in eslint-plugin-react-x
Full Name in @eslint-react/eslint-plugin
Features
🔍
🔄
Presets
core
recommended
recommended-typescript
recommended-type-checked
What it does
Disallows using React.forwardRef
.
In React 19, forwardRef
is no longer necessary. Pass ref
as a prop instead.
forwardRef
will deprecated in a future release. Learn more here.
An unsafe codemod is available for this rule.
Examples
Failing
Passing
Implementation
Further Reading
See Also
no-context-provider
Disallows using<Context.Provider>
.no-use-context
Disallows usingReact.useContext
.