Skip to content

How to embed Twitter widget? #15262

Answered by mikan3rd
mikan3rd asked this question in Help
Jul 17, 2020 · 6 comments · 2 replies
Discussion options

You must be logged in to vote

I gave up embedding the script in _document.tsx and dynamically plugged it in as follows

  React.useEffect(() => {
    const s = document.createElement("script");
    s.setAttribute("src", "https://platform.twitter.com/widgets.js");
    s.setAttribute("async", "true");
    document.head.appendChild(s);
  }, []);

Replies: 6 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by mikan3rd
Comment options

You must be logged in to vote
1 reply
@verheyenkoen
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
7 participants