How to unmount. Return does not work. I need to be able to press button and after function completes then the function will be remove from the button
const handleSubmit = () => {
ipcRenderer.send(
"EDITOR",
[ type, typeValue],
"editor_response"
);
onClose(selectedValue);
};
return <div>
<Button onClick={handleSubmit} color="primary">
Ok
</Button>
</div>
hasBeenClicked: falseto the state, update it totrueafter the first click and check its value on the next clicks to exit the function.