{"record":{"id":"b2e1556eaae956c6","repo":"oxc-project/oxc","slug":"react-hook-hook-name-does-nothing-when-called-wi","errorCode":null,"errorMessage":"React Hook {hook_name} does nothing when called with only one argument.","messagePattern":"React Hook (.+?) does nothing when called with only one argument\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/react/exhaustive_deps.rs","lineNumber":52,"sourceCode":"    ast_util::{\n        get_declaration_from_reference_id, get_declaration_of_variable, get_enclosing_function,\n    },\n    context::LintContext,\n    rule::{DefaultRuleConfig, Rule},\n    utils::deserialize_regex_option,\n};\n\nconst SCOPE: &str = \"react-hooks\";\n\nfn missing_callback_diagnostic(hook_name: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"React hook {hook_name} requires an effect callback.\"))\n        .with_label(span)\n        .with_help(\"Did you forget to pass a callback to the hook?\")\n        .with_error_code_scope(SCOPE)\n}\n\nfn dependency_array_required_diagnostic(hook_name: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\n        \"React Hook {hook_name} does nothing when called with only one argument.\"\n    ))\n    .with_label(span)\n    .with_help(\"Did you forget to pass an array of dependencies?\")\n    .with_error_code_scope(SCOPE)\n}\n\nfn unknown_dependencies_diagnostic(hook_name: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\n        \"React Hook {hook_name} received a function whose dependencies are unknown.\"\n    ))\n    .with_help(\"Pass an inline function instead.\")\n    .with_label(span)\n    .with_error_code_scope(SCOPE)\n}\n\nfn async_effect_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Effect callbacks are synchronous to prevent race conditions.\")","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/react/exhaustive_deps.rs#L34-L70","documentation":"Raised by react/exhaustive_deps when a React hook that requires a dependency array (useEffect/useCallback/useMemo etc.) is called with only one argument and no second argument at all. Unlike the 'requires an effect callback' case, the callback exists but the dependency list was omitted entirely, so the rule cannot statically verify dependency correctness and the effect may re-run every render (or never update closed-over values as the author intends). run() reports this per hook call site missing its second argument.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/react/exhaustive_deps.rs:52 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a dependency array as the second argument, e.g. useMemo(() => ..., [deps])."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}