Invalid hook call: useSession on React Native/Expo

 ERROR  Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem. 

Code: user-indicator.tsx
   7 |
   8 | export function UserIndicator({}: UserIndicatorProps) {
>  9 |   const { data: session } = useSession();
     |                                       ^
  10 |
  11 |   if (!session?.user) return null;
  12 |
Call Stack
  UserIndicator (apps/native/components/user-indicator.tsx:9:39) 


I just created a monorepo using Create Better T Stack and right in the first load, this error appeared.

I separated the Home component into a UserIndicator component, but the error persists.
Was this page helpful?