This is a react specific library for facebook authentication/login/signin.
Library link : https://www.npmjs.com/package/react-facebook-sociallogin-auth
Install dependencies
npm i react-facebook-sociallogin-auth
In your component import
import FacebookAuthLogin from 'react-facebook-sociallogin-auth';
Add component
const responseFacebook = (response) => {
console.log("logged in", response); // For Login success this function will invoked
};
const onLoginFailure = (res) => {
console.log("Login Failed:", res); // For Login success this function will invoked
};
<FacebookAuthLogin
appId={appId} //facebook auth appId
backgroundColor={"#4267B2"}
textColor= {"#fff"}
border = {"none"}
height = {"40px"}
width = {"250px"}
fontSize = {"15px"}
logoColor = {"#fff"}
logoSize = {30}
textLogin = {"Continue with Facebook"}
responseFacebook = {responseFacebook}
onLoginFailure={onLoginFailure}
/>