Migrating from Clerk components - Expo
I am switching from Clerk auth components (i.e.
<SignedIn>) to Convex with Clerk components (i.e. <Authenticated) in my Expo app mobile/web app.I want to show sign up/in buttons if unauthenticated and a sign out button if they are.
When the user signs in, it still shows the
<Unauthenticated> parts. Possible reasons:
1. I think this is because I need to update my sign in/up pages from using the
import { useSignIn } from '@clerk/clerk-expo'. 2. It is also possible that the problem is Clerk in Expo only works with some of their components (e.g.
<SignOutButton> is one I made, because Clerk's will not work in Expo).3. I am misunderstanding how/where the
useConvexAuth hook should be used.The docs don't seem to say I need to update the
useSignIn hook to a Convex specific one. The docs do sayIt's important to use theDoes this mean I should change all myuseConvexAuth()hook instead of Clerk'shook when you need to check whether the user is logged in or not.useAuth()
useAuth() hooks to useConvexAuth()s? LikeAll
import {useAuth} from '@clerk/clerk-expo' should change to import {useConvexAuth} from 'convex/react'and
const {isSignedIn} = useAuth(); should change to const {isAuthenticated} = useConvexAuth();