嵌入的Twitter时间线不在React中工作

时间:2018-04-08 01:38:38

标签: reactjs react-bootstrap twitter-timeline

我试图在react-bootstrap面板中嵌入特定页面的推特时间线但是我无法让它工作。 我没有得到任何控制台日志记录输出,这让我觉得我没有正确设置它,但我不确定是什么问题。 我正在使用react-twitter-widgets来嵌入时间轴。

我的组件如下:

import React from 'react';
import { Timeline } from 'react-twitter-widgets';

function twitterTimeline() {
  return (
    <Timeline
      dataSource={{
        sourceType: 'profile',
        screenName: 'MetEireann',
      }}
      options={{
        username: 'MetEireann',
        height: '400',
      }}
      onLoad={() => console.log('Timeline is loaded!')}
    />
  );
}

export default twitterTimeline;

然后我在我的react-bootstrap Panel中使用它:

import twitterTimeline from '../../components/TwitterTimeline';
.....

<div className="col-lg-4">
   <Panel
     header={<span>
       <i className="fa fa-bar-chart fa-fw" /> Weather Forecast
       </span>}
    >
      <twitterTimeline />
    </Panel>
</div>

正在加载组件,因此问题显然在于组件本身。 enter image description here

非常感谢任何帮助。提前谢谢。

0 个答案:

没有答案
相关问题