{"record":{"id":"31c8ecf2346defcf","repo":"oxc-project/oxc","slug":"react-does-not-recognize-data-props-with-upperca","errorCode":null,"errorMessage":"React does not recognize data-* props with uppercase characters on a DOM element","messagePattern":"React does not recognize data-\\* props with uppercase characters on a DOM element","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/react/no_unknown_property.rs","lineNumber":32,"sourceCode":"use schemars::JsonSchema;\nuse serde::Deserialize;\n\nuse crate::{\n    AstNode,\n    context::{ContextHost, LintContext},\n    globals::is_valid_aria_property,\n    rule::{DefaultRuleConfig, Rule},\n    utils::get_jsx_attribute_name,\n};\n\nfn invalid_prop_on_tag(span: Span, prop: &str, tag: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Invalid property found\")\n        .with_help(format!(\"Property '{prop}' is only allowed on: {tag}\"))\n        .with_label(span)\n}\n\nfn data_lowercase_required(span: Span, suggested_prop: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\n        \"React does not recognize data-* props with uppercase characters on a DOM element\",\n    )\n    .with_help(format!(\"Use '{suggested_prop}' instead\"))\n    .with_label(span)\n}\n\nfn unknown_prop_with_standard_name(span: Span, x1: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Unknown property found\")\n        .with_help(format!(\"Use '{x1}' instead\"))\n        .with_label(span)\n}\n\nfn unknown_prop(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Unknown property found\")\n        .with_help(\"Remove unknown property\")\n        .with_label(span)\n}\n","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/react/no_unknown_property.rs#L14-L50","documentation":"Raised by react/no_unknown_property when a `data-*` attribute on a DOM element contains uppercase characters (e.g. `data-testId`). At the throw site React will drop or warn about such props because dataset keys are lowercased to match the HTML attribute rules, so the intended data attribute never reaches the DOM as written. data_lowercase_required fires from run() with a lowercase-corrected suggested prop name in the help.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/react/no_unknown_property.rs:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the attribute to the lowercase form suggested by the diagnostic.","Keep data-* attribute names all-lowercase."],"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"}