Skip to content

Commit 47c2906

Browse files
committed
fix EmailShareButton
1 parent 944d26f commit 47c2906

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.changeset/quiet-wolves-whisper.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
"react-share": patch
3+
---
4+
Fix `EmailShareButton`: a bug slipped in that broke the sharing functionality.

src/EmailShareButton.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type React from 'react';
21
import objectToGetParams from './utils/objectToGetParams';
32
import createShareButton from './hocs/createShareButton';
43

@@ -22,11 +21,8 @@ const EmailShareButton = createShareButton<Options>(
2221
}),
2322
{
2423
openShareDialogOnClick: false,
25-
onClick: (event: React.MouseEvent<HTMLButtonElement>) => {
26-
const link = event.currentTarget.getAttribute('data-link');
27-
if (link) {
28-
window.location.href = link;
29-
}
24+
onClick: (_, link: string) => {
25+
window.location.href = link;
3026
},
3127
},
3228
);

0 commit comments

Comments
 (0)