Sign in, sign up and one-time-code verification screens with social providers.
import { SignInScreen } from "@/screens/sign-in-screen";
return (
<SignInScreen
onSubmit={async (email, password) => {
const res = await fetch("https://api.example.com/auth/sign-in", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ email, password }),
});
if (!res.ok) throw new Error("Wrong email or password.");
router.replace("/(tabs)");
}}
onSocial={(provider) => console.log("sign in with", provider)}
onForgotPassword={() => router.push("/forgot-password")}
onSignUp={() => router.push("/sign-up")}
/>
);| Prop | Type | Default | Description |
|---|---|---|---|
onSubmitrequired | (email: string, password: string) => Promise<void> | — | Called with validated credentials. Throw to show an error. |
onSocial | (provider: "apple" | "google") => void | undefined | Social sign-in handler. Hides the buttons when omitted. |
onForgotPassword | () => void | undefined | Forgot password link. |
onSignUp | () => void | undefined | Footer link to the sign-up screen. |