react-doctor/no-call-component-as-function
Component called as a function
- Category: Bugs
- Severity: warn
- Source:
oxlint-plugin-react-doctor - Framework: global
- Enabled when: react
- Tags: test-noise
- Default: Enabled
Validation prompt
Use this to decide whether a fired diagnostic is real or a false positive.
Confirm the reported code matches Component called as a function. Check the framework context and diagnostic message before suppressing it.
Fix prompt
Use this once validation confirms the diagnostic is real.
Render components as JSX (<Component />), never call them like functions (Component(props)). A direct call runs the component outside React and breaks hooks, state, and memoization.
Related rules
More Bugs rules from the rules reference:
react-doctor/no-cascading-set-state: Combine into useReducer: `const [state, dispatch] = useReducer(reducer, initialState)`react-doctor/no-chain-state-updates: Disallow chaining state changes in an effect.react-doctor/no-children-prop: Disallow passing children as an explicit prop — nest content between the opening and closing tags instead.react-doctor/no-create-context-in-render: Move createContext to module scope so its Context identity stays stable across rendersreact-doctor/no-create-ref-in-function-component: createRef in function component