react-share: [Error] EmailShareButton is not working

            <EmailShareButton style={{ margin: '0.5rem' }} url={publicUrl} subject='t' body="<div>test</div>">
                <EmailIcon size={60} round />
            </EmailShareButton>,

Here is my code when I click button, nothing happen

my package is

"react": "^16.12.0",
"react-share": "^4.0.1",

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 2
  • Comments: 16 (1 by maintainers)

Most upvoted comments

@blasphemic I’ve used this workaround until it gets fixed:

const handleEmailOnClick = () => {
    window.location.href = encodeURI(`mailto:
    ?subject=${Some.Variable} Subject Here
    &body=Hi,\n\nYou Can bla Bla bla "${some.variable}" At ${url}\n\nEnjoy,`);
  };
return (
  <EmailShareButton url={MY_URL} onClick={handleEmailOnClick}>
        <EmailIcon />
   </EmailShareButton>
);