react/forward-ref-uses-ref
eslint-plugin-react
Suggestion
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/forward-ref-uses-ref": "error",
},
},
];var React = require('react');
var Component = React.forwardRef((props) => (
<div />
));var React = require('react');
var Component = React.forwardRef((props, ref) => (
<div ref={ref} />
));
var Component = React.forwardRef((props, ref) => (
<div />
));
function Component(props) {
return <div />;
};Examples from the Oxlint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
react/forward-ref-uses-ref
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/forward-ref-uses-ref": "error",
},
},
];react/forward-ref-uses-ref
react plugin · correctness
{
"plugins": [
"react"
],
"rules": {
"react/forward-ref-uses-ref": "error"
}
}Biome does not have this rule.
Ensure destructuring and symmetric naming of useState hook value and setter variables
Enforce using onChange or readonly attribute when checked is used