megaMenu with NextJs server side - feature request

UI Components for React
Post Reply
chrishj
Posts: 206
Joined: 11 Jul 2011, 21:58

12 Nov 2022, 09:24

Hi,
I am attempting to use MegaMenu with NextJs 13 app dir.

I get the error message:
TypeError: React__namespace.useState is not a function

The NavBar.tsx code extract is

Code: Select all


import Link from 'next/link';
import { useRouter } from 'next/navigation';
import { InputText } from 'primereact/inputtext';
import { MegaMenu } from 'primereact/megamenu';

'use client';

return (
		<>
			<MegaMenu model={megaItems} orientation="horizontal" end={end} />
Is it possible to have a parameter so useState is not used for NextJs serverside components?
PrimeReact: 8.5.0
NextJs: 13.0.0
Theme Apollo v7.0
Database pg 8.8.0
react-hook-foem: 7.38.0

Melloware
Posts: 3385
Joined: 22 Apr 2013, 15:48

13 Nov 2022, 14:44

You would probably have to request this enhancment on the GitHub Issues page.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 12.0.0 / PF Extensions 12.0.1
PrimeReact 8.6.1

chrishj
Posts: 206
Joined: 11 Jul 2011, 21:58

14 Nov 2022, 13:09

Thanks, I have created the request on Github
PrimeReact: 8.5.0
NextJs: 13.0.0
Theme Apollo v7.0
Database pg 8.8.0
react-hook-foem: 7.38.0

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests