Problem when implementing 'use client'.
Answered
Little Ringed Plover posted this in #help-forum
Little Ringed PloverOP
Hi ! I'm new with Next.js and i'm doing the Learn Next.js course. I'm in the chapter 5 'Navigating Between Pages'. In the 'Pattern: Showing active links', after import 'use client' my app crashes and throw the error on the picture. I also add my code in a picture.
Any ideas ?
Any ideas ?
Answered by Little Ringed Plover
I found that if you import 'use client' in 'sidenav.ts' (not in 'nav-link.tsx' as the tutorial say's) it's work.
3 Replies
Little Ringed PloverOP
These's my project structure.
Little Ringed PloverOP
I found that if you import 'use client' in 'sidenav.ts' (not in 'nav-link.tsx' as the tutorial say's) it's work.
Answer
Palomino
Thank you for posting your fix - I ran into the exact same issue.