keppelen / react-facebook-login

A Component React for Facebook Login
1.18k stars 406 forks source link

React facebook login do not open any popup or redirect in my react app? #352

Open siamahnaf opened 1 year ago

siamahnaf commented 1 year ago

I am try to integrate my react-facebook-login into nextjs, typescript project. But in this project it can't open any thing like redirect or popup for login access. Where is the problem actually I can't understand. I am finding any solutions, blog or video. Please help me by giving the possible problem occurred and suggest how can I solve that problem.

Here is my Code example-

import FacebookLogin, { RenderProps } from "react-facebook-login/dist/facebook-login-render-props";

const responseFacebook = (response: any) => {
    console.log(response)
}

<FacebookLogin
    appId = "265554609068125"
    autoLoad = {false}
    fields = "name,email,picture"
    callback = {responseFacebook}
    render = {(renderProps: RenderProps) => (
       <button onClick={renderProps.onClick} >
          Hello
       </button>
    )}
/>

You can checkout this url for getting problem in live demo - https://www.nekmart.com/users/login

In console I find this line-

FB.login() called before FB.init().