Skip to content

Commit 373aafa

Browse files
committed
refactor(ShareButton): Reduced amount of changes to simplify review
1 parent ceb4548 commit 373aafa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ShareButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ interface CustomProps<LinkOptions> {
9292
* Takes a function that returns a Promise to be fulfilled before calling
9393
* `onClick`. If you do not return promise, `onClick` is called immediately.
9494
*/
95-
beforeOnClick?: () => void | Promise<void>;
95+
beforeOnClick?: () => Promise<void> | void;
9696

9797
/**
9898
* Takes a function to be called after closing share dialog.
@@ -133,7 +133,7 @@ export default class ShareButton<LinkOptions> extends Component<Props<LinkOption
133133
windowOpen(link, windowConfig, onShareWindowClose);
134134
};
135135

136-
handleClick = async (event: React.MouseEvent<HTMLButtonElement>): Promise<void> => {
136+
handleClick = async (event: React.MouseEvent<HTMLButtonElement>) => {
137137
const {
138138
beforeOnClick,
139139
disabled,

0 commit comments

Comments
 (0)