Next.js Discord

Discord Forum

What is wrong here?

Answered
Mallow bee posted this in #help-forum
Open in Discord
Mallow beeOP
So it says i cant use async/await in react server components but i have "use client" in my page
"use client";

import React from "react";
import { useSession } from "next-auth/react";

export default async function Home() {
  const { data: session, status } = useSession();

  return (
    <div>
      <h1>Hello</h1>
    </div>
  );
}
Answered by riský
make your function (remove the async part) to use client components
export default function Home() {
View full answer

3 Replies