diff --git a/crates/oxc_linter/src/rules/react/button_has_type.rs b/crates/oxc_linter/src/rules/react/button_has_type.rs
index 1ad7d7102..637700eef 100644
--- a/crates/oxc_linter/src/rules/react/button_has_type.rs
+++ b/crates/oxc_linter/src/rules/react/button_has_type.rs
@@ -223,6 +223,7 @@ fn test() {
(r"", None),
(r"", None),
(r#""#, Some(serde_json::json!([{ "reset": false }]))),
+ (r#"createElement("span")"#, None),
(r#"React.createElement("span")"#, None),
(r#"React.createElement("span", {type: "foo"})"#, None),
(r#"React.createElement("button", {type: "button"})"#, None),
@@ -290,6 +291,7 @@ fn test() {
r#""#,
Some(serde_json::json!([{ "reset": false }])),
),
+ (r#"createElement("button")"#, None),
(r#"React.createElement("button")"#, None),
(r#"React.createElement("button", {type: foo})"#, None),
(r#"React.createElement("button", {type: "foo"})"#, None),
diff --git a/crates/oxc_linter/src/snapshots/button_has_type.snap b/crates/oxc_linter/src/snapshots/button_has_type.snap
index 389b90f2c..01b884d39 100644
--- a/crates/oxc_linter/src/snapshots/button_has_type.snap
+++ b/crates/oxc_linter/src/snapshots/button_has_type.snap
@@ -108,6 +108,13 @@ expression: button_has_type
╰────
help: Change the `type` attribute to one of the allowed values: `button`, `submit`, or `reset`.
+ ⚠ eslint-plugin-react(button-has-type): `button` elements must have an explicit `type` attribute.
+ ╭─[button_has_type.tsx:1:1]
+ 1 │ createElement("button")
+ · ───────────────────────
+ ╰────
+ help: Add a `type` attribute to the `button` element.
+
⚠ eslint-plugin-react(button-has-type): `button` elements must have an explicit `type` attribute.
╭─[button_has_type.tsx:1:1]
1 │ React.createElement("button")
diff --git a/crates/oxc_linter/src/utils/react.rs b/crates/oxc_linter/src/utils/react.rs
index c246774ef..44488d5a4 100644
--- a/crates/oxc_linter/src/utils/react.rs
+++ b/crates/oxc_linter/src/utils/react.rs
@@ -15,6 +15,10 @@ pub fn is_create_element_call(call_expr: &CallExpression) -> bool {
return member_expr.static_property_name() == Some("createElement");
}
+ if let Some(ident) = call_expr.callee.get_identifier_reference() {
+ return ident.name == "createElement";
+ }
+
false
}