react-twitter-embed
react-twitter-embed copied to clipboard
onClick event for follow button
Lets people add an onClick
property as a function to be called whenever the twitter button is clicked. Use cases: tracking, user feedback, etc.
I tried to follow the coding conventions of the repo, let me know if anything is incorrect.
@saurabhnemade Desperately need this functionality for my project
Scratch that! Just realized it is only for button!
~However, @BaliBalo , I installed your version from github and implemented like so, to no avail. The event is never called~
<TwitterTweetEmbed
placeholder={<div className={classes.placeholder} />}
tweetId={article.tweet}
options={OPTIONS}
onClick={(e) => onClick(e)}
/>
function onClick(event) {
event.preventDefault();
event.stopPropagation();
console.log(event.target);
}
"react-twitter-embed": "BaliBalo/react-twitter-embed#features/onClick-follow-button",
Closing due to conflicts with new TypeScript code and lack of interest - if someone feels like it, feel free to port this code in a new PR