When should you actually use getShadowHostId?

There are a few examples of getShadowHostId being used in the examples git repo. In the example here for google, the sidebar no longer shows when I rename or remove the getShadowHostId line. (https://github.com/PlasmoHQ/examples/blob/main/with-content-scripts-ui/contents/google-sidebar.tsx#L20) But in this example on the plasmo website, it still works perfectly whether I remove it or not, or rename it. https://github.com/PlasmoHQ/examples/blob/main/with-content-scripts-ui/contents/plasmo-inline.tsx#L11 If getShadowHostId is mainly used to optimize unmount lookups, the why is it affecting the UI in the google example? I still can't understand when I should use it or not. Thanks.
GitHub
examples/with-content-scripts-ui/contents/google-sidebar.tsx at mai...
🔰 Example projects that demonstrate how to use the Plasmo Framework and integrate with popular tools - PlasmoHQ/examples
GitHub
examples/with-content-scripts-ui/contents/plasmo-inline.tsx at main...
🔰 Example projects that demonstrate how to use the Plasmo Framework and integrate with popular tools - PlasmoHQ/examples
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server