Rules
no-forward-ref
Full Name in eslint-plugin-react-x
Full Name in @eslint-react/eslint-plugin
Features
🔄
Presets
corerecommendedrecommended-typescriptrecommended-type-checked
Description
Replaces usages of forwardRef with passing ref as a prop.
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-useless-forward-ref
Enforces thatforwardRefis only used when arefparameter is declared.no-context-provider
Replaces usages of<Context.Provider>with<Context>.no-use-context
Replaces usages ofuseContextwithuse.