I am trying to download the facebook comment plugin in a ReactJS application that currently uses React Router.
If I put the facebook initialization code inside my component_idMount () method, it will load for the first time. But, going to another page and then returning to it again, it will not load the plugin.
Is there anything I need to do so that it appears all the time?
I think I need to remove init again and reinitialize facebook. But this is not so.
Any suggestions? Below is my component code
`` ``
import React, { Component } from 'react'; import SlidingPanels from '../components/SlidingPanels'; export class Feedback extends Component { constructor() { super(); } componentDidMount() { $(window).scrollTo(0, '0.5s'); window.fbAsyncInit = function() { FB.init({ appId : '115517331888071', cookie : true,
``
Thanks, John.
facebook reactjs react-router
John fu
source share