a-tokyo / react-apple-signin-auth

 Apple signin for React using the official Apple JS SDK

Home Page:https://a-tokyo.github.io/react-apple-signin-auth

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom callback onClick

DDexster opened this issue · comments

It would be great to provide some callback when Apple button is clicked, in order to prevent app interaction when the popup is triggered.

You can use the render prop to achieve that.

eg:

/** Apple Signin button */
const MyAppleSigninButton = () => (
  <AppleSignin
    // ... config
    /** render function - called with all props - can be used to fully customize the UI by rendering your own component  */
    render={(props) => <button {...props} onClick={() => {
       // do custom handling here
       props.onClick();
    }}>My Custom Button</button>}
  />
);