How to use the react-social-login function in react-social-login

To help you get started, we’ve selected a few react-social-login examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github guandjoy / redfish / src / landing-page / src / components / authentication / AuthWithFacebook.js View on Github external
key
    }
  }
`

const Button = ({ children, triggerLogin, densed, ...props }) => (
  <button> triggerLogin()}
    {...props}
  &gt;
    {children}
  </button>
)

const SocialButton = SocialLogin(Button)

function AuthWithFacebook(props) {
  const isBrowser = useBrowser()

  const [isAuth, setIsAuth] = useState(false)
  const [
    authWithFacebook,
    { loading: mutationLoading, error, data },
  ] = useMutation(AUTH_WITH_FACEBOOK)
  const [accessToken, setAccessToken] = useState()

  // Turn on spinner
  const client = useApolloClient()
  useEffect(() =&gt; {
    client.writeData({ data: { sending: mutationLoading || isAuth || false } })
  }, [mutationLoading, isAuth])
github yuchiu / Slack-Clone / client / src / components / common / SocialButton / SocialButton.js View on Github external
render() {
    const { children, triggerLogin, ...props } = this.props;
    return (
      <div>
        {children}
      </div>
    );
  }
}

export default SocialLogin(Button);

react-social-login

React Component for Login via Social Providers

MIT
Latest version published 1 year ago

Package Health Score

58 / 100
Full package analysis

Popular react-social-login functions