react-doctor/no-generic-handler-names
Rename to describe the action: e.g. `handleSubmit` → `saveUserProfile`, `handleClick` → `toggleSidebar`
- Category: Architecture
- Severity: warn
- Source:
oxlint-plugin-react-doctor - Framework: global
- Enabled when: always
Validation prompt
Use this to decide whether a fired diagnostic is real or a false positive.
Fires only when a JSX prop literally mirrors its handler on a generic DOM event: onClick={handleClick}, onChange={handleChange}, onInput={handleInput}, onBlur={handleBlur}, onFocus={handleFocus}. Anything else (onClick={openModal}, onSubmit={...}, custom event names, inline arrow functions) is ignored, so false positives are rare. Confirm the handler name carries zero semantic information about what the action actually does.
Fix prompt
Use this once validation confirms the diagnostic is real.
Rename the handler at its definition and every call site to describe the action it performs, e.g. handleClick to toggleSidebar, handleChange to updateSearchQuery, handleSubmit to saveUserProfile. Use an IDE rename refactor so React DevTools traces and stack frames stay readable. See https://react.dev/learn/responding-to-events#naming-event-handler-props
Related rules
More Architecture rules from the rules reference:
react-doctor/no-giant-component: Extract logical sections into focused components: `<UserHeader />`, `<UserActions />`, etc.react-doctor/no-gradient-text: Use solid text colors for readability. If you need emphasis, use font weight, size, or a distinct color instead of gradientsreact-doctor/no-inline-exhaustive-style: Move styles to a CSS class, CSS module, Tailwind utilities, or a styled component — inline objects with many properties hurt readability and create new references every renderreact-doctor/no-many-boolean-props: Split into compound components or named variants: `<Button.Primary />`, `<DialogConfirm />` instead of stacking `isPrimary`, `isConfirm` flagsreact-doctor/no-multi-comp: Move secondary components into their own files.