Skip to content

Commit

Permalink
refactor(ShareButton): Reduced amount of changes to simplify review
Browse files Browse the repository at this point in the history
  • Loading branch information
Kashuab committed Jul 23, 2020
1 parent ceb4548 commit 373aafa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ShareButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ interface CustomProps<LinkOptions> {
* Takes a function that returns a Promise to be fulfilled before calling
* `onClick`. If you do not return promise, `onClick` is called immediately.
*/
beforeOnClick?: () => void | Promise<void>;
beforeOnClick?: () => Promise<void> | void;

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

handleClick = async (event: React.MouseEvent<HTMLButtonElement>): Promise<void> => {
handleClick = async (event: React.MouseEvent<HTMLButtonElement>) => {
const {
beforeOnClick,
disabled,
Expand Down

0 comments on commit 373aafa

Please sign in to comment.