Have an error only in safari browser:
TypeError: undefined is not an object (evaluating 'navigator.clipboard.writeText')
I'm passing my current link. What could be the problem?
copyLink = e => {
e.preventDefault();
console.log(document.location.href)
navigator.clipboard
.writeText(document.location.href)
.then(() => {
this.setState({
urlIsCopied: true
});
})
.catch(e => console.error(e));
};