0

./src\app\page.tsx ReactServerComponentsError:

You're importing a component that needs useState. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.

    ,-[C:\Users\HP\Desktop\Tailwind Portfolio\react-portfolio\src\app\page.tsx:4:1]
  4 | import {AiFillTwitterCircle,AiFillLinkedin, AiFillYoutube} from 'react-icons/ai'
  5 | 
  6 | 'use client';
  7 | import { useState } from 'react';
    :          ^^^^^^^^
  8 |  
  9 | export default function Home() {
 10 |   const [darkMode, setDarkMode] = useState(false);
    `----

Maybe one of these should be marked as a client entry with "use client":
  ./src\app\page.tsx
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Oakar
  • 1

0 Answers0