'useRef' is not exported from 'react'

Hi, on my NEXTJS website I try to install better auth and I have this error that I can't solve
No description
4 Replies
KiNFiSH
KiNFiSH2mo ago
https://github.com/better-auth/better-auth/issues/3123 can you please confirm if this is actually the issue ?
GitHub
Better Auth's React hooks fail when used with Next.js 15 App Router...
Is this suited for github? Yes, this is suited for github To Reproduce Create Next.js 15 app with App Router Install better-auth@1.2.10 Create auth client: import { createAuthClient } from "be...
Lord-forgos
Lord-forgosOP2mo ago
I have the impression that it's the same mistake, yes. I only have one version of React, so it must be because of the SSR :/. Thank you
KiNFiSH
KiNFiSH2mo ago
if you do have one version of react that's not the dual problem. your react client still referencing the right instance how does this error appears ? after installing the better-auth or while using it ?
Lord-forgos
Lord-forgosOP2mo ago
When I using it, I will try to reinstall better-auth of 0 I think, may I have broke something Mb it's when I install them To be more precise, the problem occurred when I exported the functions from my auth-client.ts to my lib/index.ts (useSession, signIn, signUp and signOut)
import {createAuthClient} from "better-auth/react";

const authClient = createAuthClient({});

export const {useSession, signIn, signUp, signOut} = authClient;
import {createAuthClient} from "better-auth/react";

const authClient = createAuthClient({});

export const {useSession, signIn, signUp, signOut} = authClient;

Did you find this page helpful?