Question: anybody knows how to disable refresh. the following does not seem to work.

```
window.addEventListener("beforeunload", () => { 
    return false; 
});

```

Answer: 
Probably the best thing you can do (with respect to you wanting to prevent a user from accidentally leaving the voice call) is to show them a message they have to confirm before they leave. Try this:

`window.onbeforeunload = ()=>"If you leave this page, you'll also leave the call";`

Maybe you can also do that in the addListener syntax you already tried (simply return a string instead of false and change onunload to onbeforeunload).
This is done in the components class by the shouldComponentUpdate function, and in use effect by the input parameter, although it can be controlled by rect.memo and pure component and use callback and use memo