How to listen to port with React

I want listening to a port in sidepanel I have check in my background file port and the sender and port handler are correctly configured, the problem is in the receiver I try this
export default SidePanel() {
const port = usePort("node")
useEffect(() => {
...
}, [port)
return <div>Hello world</div>
}
export default SidePanel() {
const port = usePort("node")
useEffect(() => {
...
}, [port)
return <div>Hello world</div>
}
But it don't work and the div is not even rendering, I tried without hook (getPort) and it is the same
2 Replies
lukky954
lukky954OP•12mo ago
Or I have misunderstood and a message can't be sent from content script and received in side panel via port ?
Arcane
Arcane•12mo ago
@lukky954 has reached level 1. GG!
Want results from more Discord servers?
Add your server