Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
15 lines
510 B
Plaintext
15 lines
510 B
Plaintext
import { Fragment } from 'react';
|
|
import { HTMLVisualElement } from '../html/HTMLVisualElement.mjs';
|
|
import { SVGVisualElement } from '../svg/SVGVisualElement.mjs';
|
|
import { isSVGComponent } from './utils/is-svg-component.mjs';
|
|
|
|
const createDomVisualElement = (Component, options) => {
|
|
return isSVGComponent(Component)
|
|
? new SVGVisualElement(options)
|
|
: new HTMLVisualElement(options, {
|
|
allowProjection: Component !== Fragment,
|
|
});
|
|
};
|
|
|
|
export { createDomVisualElement };
|