react/no-multi-comp
eslint-plugin-react
No autofix
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/no-multi-comp": "error",
},
},
];var Hello = createReactClass({
render: function() {
return <div>Hello {this.props.name}</div>;
}
});
var HelloJohn = createReactClass({
render: function() {
return <Hello name="John" />;
}
});var Hello = require('./components/Hello');
var HelloJohn = createReactClass({
render: function() {
return <Hello name="John" />;
}
});Examples from the ESLint 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/no-multi-comp
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/no-multi-comp": "error",
},
},
];react/no-multi-comp
react plugin · restriction
{
"plugins": [
"react"
],
"rules": {
"react/no-multi-comp": "error"
}
}Biome does not have this rule.
Ensure destructuring and symmetric naming of useState hook value and setter variables
Require all forwardRef components include a ref parameter