style/useReactFunctionComponents
style · since 2.1.3
No autofix
biome.json
{
"linter": {
"rules": {
"style": {
"useReactFunctionComponents": "error"
}
}
}
}Enforce that components are defined as functions and never as classes.
class Foo extends React.Component {
render() {
return (
<div>This is a class component.</div>
);
}
}function Foo() {
return <div>This is a function component.</div>;
}Examples from the Biome 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.
ESLint does not have this rule.
Oxlint does not have this rule.
style/useReactFunctionComponents
style · since 2.1.3
{
"linter": {
"rules": {
"style": {
"useReactFunctionComponents": "error"
}
}
}
}Enforces naming conventions for React createContext, useId, and useRef.
Enforce using Solid's <For /> component for mapping an array to JSX elements.
Require Svelte stores to be created with an initial value.