Search code examples
node.jsreactjsgoogle-chromeexpressfacebook-comments

Facebook Comment is not shown on page


i just added Facebook Comment Plugin on my website created with NodeJS and ReactJS and this is generated code

<div id="fb-root"></div>
<script async defer crossOrigin="anonymous" 
src="https://connect.facebook.net/ka_GE/sdk.js#xfbml=1&version=v3.3"></script>\

<div className="fb-comments" data-href="http://localhost:3000/recipe/:id/:name" 
data-width="" data-numposts="5"></div>

but it does not shows anything on the page, i use chrome and i disabled adblock on that page but nothing changed anyway, what is the reason of this and how can I fix it? Thanks


Solution

  • You must use library react-facebook, in example :

    import React, { Component} from 'react';
    import { FacebookProvider, Comments } from 'react-facebook';
    
    export default class Example extends Component {
      render() {
        return (
          <FacebookProvider appId="123456789">
            <Comments href="http://www.facebook.com" />
          </FacebookProvider>
        );
      }
    }
    

    You can find it at npmjs for more detail.