How to integrate the Twitter widget into Reactjs?

前端 未结 9 2368
我在风中等你
我在风中等你 2021-02-18 20:33

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:

9条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-18 21:20

    IMHO you should split it down in two. A part of your code could be somehow rendered in a React component

    /**
     * @jsx React.DOM
     */
    var React = require('react');
    var twitterWidget = React.createClass({
        render: function () {
            return (
                
            );
        }
    });
    React.renderComponent(, document.getElementById('containerId');
    

    Your script tag could be placed, as a separate React component or as normal HTML just above the closing body tag.

提交回复
热议问题