Implement Facebook API login with reactjs

后端 未结 10 1980
广开言路
广开言路 2020-12-04 09:25

I\'m working on using Facebook\'s Javascript SDK for authentication. I\'ve been able to import the SDK properly and put a Like button on my page. But, the facebook login but

10条回答
  •  抹茶落季
    2020-12-04 10:09

    Try using this library: https://github.com/keppelen/react-facebook-login

    Works quite straightforward:

    import React from 'react';
    import ReactDOM from 'react-dom';
    import FacebookLogin from 'react-facebook-login';
    
    const responseFacebook = (response) => {
      console.log(response);
    }
    
    ReactDOM.render(
      ,
      document.getElementById('demo')
    );
    

提交回复
热议问题