skip to Main Content

Reactjs – Next.js Error: async/await Not Supported in React Client Component Despite No Usage – 'use client' Causing Issue"

For simplicity, I have this useState function 'use client' import {useState} from 'react'; const Home = () => { const [juice, setJuice] = useState('apple'); return ( <div className='w-full flex flex-col lg:flex-row h-40 bg-black' onClick={() => setJuice('orange')}> <p className='text-white text-2xl font-bold…

VIEW QUESTION

Javascript – Nextjs: How to dynamically set the <header> content based on the component loaded

I created a app/components/Header.js component. export function Header() { return <> <header className="w-full h-14 grid grid-cols-12 bg-gray-50 text-black dark:bg-gray-900 dark:text-white"> <div className="left self-center col-span-3"> <div className="logo text-black dark:text-white ml-6 text-xl"> <a href="#">Logo</a> </div> </div> <div className="center self-center col-span-6 text-center"> <p>{…

VIEW QUESTION
Back To Top
Search