getInlineAnchor being invoked repeatedly, even after CSUI is rendered

is it normal for getInlineAnchor to be invoked repeatedly by the Plasmo framework, even after the anchor is found to exist and the CSUI renders? I have a very basic extension, where I just want to add a button next to the <body> element of the page. I have the following snippet
export const getInlineAnchor: PlasmoGetInlineAnchor = async () => {
console.log('getInlineAnchor');
return document.body;
};

const MyComponent = () => {
return <div>Hello World</div>;
};

export const config: PlasmoCSConfig = {
matches: ['https://www.linkedin.com/sales/search/people*'],
};

export const getShadowHostId = () => "plasmo-inline-example-unique-id"

export default MyComponent;
export const getInlineAnchor: PlasmoGetInlineAnchor = async () => {
console.log('getInlineAnchor');
return document.body;
};

const MyComponent = () => {
return <div>Hello World</div>;
};

export const config: PlasmoCSConfig = {
matches: ['https://www.linkedin.com/sales/search/people*'],
};

export const getShadowHostId = () => "plasmo-inline-example-unique-id"

export default MyComponent;
and despite my button rendering, I notice that getInlineAnchor is still printed out in console.
3 Replies
ruddhboy
ruddhboyOP•3mo ago
For what its worth, it looks like render() still only gets called once per anchor. SO it looks like only getInlineAnchor is being called multiple times.
Arcane
Arcane•3mo ago
@ruddhboy has reached level 1. GG!
ruddhboy
ruddhboyOP•3mo ago
GitHub
[BUG] Excessive getInlineAnchor calls due to mountInterval · Issue ...
What happened? Excessive getInlineAnchor calls due to mountInterval, causes querySelector to run multiple times a second... See timestamps in logs // @ts-expect-error plasmo expects defined export ...
Want results from more Discord servers?
Add your server