"use client" import { useSession } from "next-auth/react" import { Button } from "./ui/button" import { Input } from "./ui/input" import { useState } from "react" import SessionData from "./session-data" import CustomLink from "./custom-link" const UpdateForm = () => { const { data: session, update } = useSession() const [name, setName] = useState(session?.user.name ?? "") if (!session) return null return ( <>
This page fetches session data client side using the{" "}
useSession
It needs the{" "}
'use client'
SessionProvider
client-example/page.tsx
{" "}
to provide the session data.