Skip to content

Commit

Permalink
🐛 use shadow root element to query qiankun head directlly (#2148)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuitos authored Jun 15, 2022
1 parent 1faa094 commit c73265d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/sandbox/patchers/dynamicAppend/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ declare global {
}

export const getAppWrapperHeadElement = (appWrapper: Element | ShadowRoot): Element => {
const rootElement = 'host' in appWrapper ? appWrapper.host : appWrapper;
return rootElement.getElementsByTagName(qiankunHeadTagName)[0];
return appWrapper.querySelector(qiankunHeadTagName)!;
};

export function isExecutableScriptType(script: HTMLScriptElement) {
Expand Down

1 comment on commit c73265d

@vercel
Copy link

@vercel vercel bot commented on c73265d Jun 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.