#useRef error

5 messages · Page 1 of 1 (latest)

warm spireBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

potent spire
#

I'm getting this error:

ReactServerComponentsError:

You're importing a component that needs useRef. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.
Learn more: https://nextjs.org/docs/getting-started/react-essentials

   ╭─[C:\Users\Lorenzo\Desktop\heisensarms\app\components\Navbar.tsx:1:1]
 1 │ import { useRouter } from "next/router";
 2 │ import { useEffect, useRef } from "react";
   ·                     ──────
 3 │ import { useUser } from "@clerk/nextjs";
 4 │ import { UserButton } from "@clerk/nextjs";
 4 │ 
   ╰────

Maybe one of these should be marked as a client entry with "use client":
  ./app\components\Navbar.tsx
  ./app\page.tsx```
dim rivet
potent spire
dim rivet
#

UserContext not found in useUser hook