Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

191
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda