How to access the current anchor in CSUI

Would it be possible to get current anchor inside the content component? Like if I'm mounting to multiple anchors and the logic needs to get input from a child element of that specific element @Jenya : https://discord.com/channels/946290204443025438/946290204904390690/1057702630404653057
5 Replies
lab
labOP•2y ago
The anchor is passed down as a child props of the CSUI. You may access it like this:
const OverlayStuff = ({ anchor }) => ...

export default OverlayStuff
const OverlayStuff = ({ anchor }) => ...

export default OverlayStuff
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
YAGPDB.xyz
YAGPDB.xyz•2y ago
Gave +1 Rep to @louis
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
lab
labOP•2y ago
there's a type to it you can use FC<PlasmoCSUIProps> (FC from react, PlasmoCSUIProps from plasmo) for the typing anchor has this type:
export type PlasmoCSUIAnchor = {
element: Element
type: "overlay" | "inline"
}
export type PlasmoCSUIAnchor = {
element: Element
type: "overlay" | "inline"
}
Want results from more Discord servers?
Add your server