use swc_ecma_ast::*;
pub(super) fn should_use_create_element(attrs: &[JSXAttrOrSpread]) -> bool {
let mut seen_prop_spread = false;
for attr in attrs {
if seen_prop_spread
&& match attr {
JSXAttrOrSpread::JSXAttr(attr) => match &attr.name {
JSXAttrName::Ident(i) => i.sym == "key",
JSXAttrName::JSXNamespacedName(_) => false,
#[cfg(swc_ast_unknown)]
_ => panic!("unable to access unknown nodes"),
},
_ => false,
}
{
return true;
}
if let JSXAttrOrSpread::SpreadElement(_) = attr {
seen_prop_spread = true;
}
}
false
}