Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

189
Views
How to implement Twitter share button with success tweeted callback in react

componentDidMount() {

window.twttr = (function (d, s, id) {

var js,

fjs = d.getElementsByTagName(s)[0],

t = window.twttr || {};

if (d.getElementById(id)) return t;

js = d.createElement(s);

js.id = id;

js.src = 'https://platform.twitter.com/widgets.js';

fjs.parentNode.insertBefore(js, fjs);

t._e = [];

t.ready = function (f) {

t._e.push(f);

};

return t;

})(document, 'script', 'twitter-wjs');

twttr.widgets.load()

}

shareOnTwitter = () => { var tweetUrl = 'https://twitter.com/intent/tweet?url=' + window.location.href; var x = screen.width / 2 - 700 / 2; var y = screen.height / 2 - 450 / 2; var child = window.open(tweetUrl, "popupWindow", "width=600, height=400,left=" + x + ",top=" + y); child.focus(); twttr.ready(function (twttr) { twttr.events.bind('tweet', function () { alert('Tweeted!'); }); }); };

<a onClick={this.shareOnTwitter} // class="twitter-share-button" >Tweet</a>

I have add twitter widgets on componentDidMount but i don't understand how i check user tweeted or not.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!