function createElement({ node, style, useInlineStyles, key }) {
const { properties, type, tagName, value } = node;
if (type === "text") {
return value;
} else if (tagName) {
const TagName = tagName;
const childrenCreator = createChildren(style, useInlineStyles);
const props = (
useInlineStyles
? { style: createStyleObject(properties.className, style) }
: { className: createClassNameString(properties.className) }
);
const children = childrenCreator(node.children);
return <TagName key={key} {...props}>{children}</TagName>;
}
}