mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
refactor(modal): use framework delegate for mounting the user's component
This commit is contained in:
10
packages/react/src/utils/helpers.ts
Normal file
10
packages/react/src/utils/helpers.ts
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
export function getOrAppendElement(tagName: string): Element {
|
||||
const element = document.querySelector(tagName);
|
||||
if (element) {
|
||||
return element;
|
||||
}
|
||||
const tmp = document.createElement(tagName);
|
||||
document.body.appendChild(tmp);
|
||||
return tmp;
|
||||
}
|
Reference in New Issue
Block a user