I want to add the Twitter widget into React, but I don\'t know where to start or how to do it. I am very new to React JS.
Here is the HTML version of the code:
There are few interesting solutions out there, but all of those are injecting twitters code to website.
What would I suggest is to create another empty html file just for this widget. Eg. /twitter.html
, where you can place all dirty JavaScripts and render widget.
Then when you include:
It will work without any issues. Plus, you have separated external scripts - so it's good for security.
Just add some styling to make it look fine:
twitter.html
html,
body {
margin: 0;
padding: 0;
}
React's iframe
iframe {
border: none;
height: ???px;
}