Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Super expression must either be null or a function, not undefined #493

Open
Lazy974 opened this issue Jun 28, 2023 · 4 comments
Open

Comments

@Lazy974
Copy link

Lazy974 commented Jun 28, 2023

Hello and thank you for your contribution :)

Having used react burger menu in the past, I haven't encountered any problems. However, in a new project, when I do: import { slide as Menu } from "react-burger-menu";

I get the error: Super expression must either be null or a function, not undefined

The project is under Nextjs 13 and React 18.2

How can I solve the problem?

@WilliamYuhangLee
Copy link

Having this problem too, also using NextJS 13, TypeScript and React 18.2

@Lazy974
Copy link
Author

Lazy974 commented Jul 16, 2023

Hello, the problem has been solved. After searching, you need to use the client component to call React Hooks.

Source : https://nextjs.org/docs/getting-started/react-essentials

@khaledmousa95
Copy link

Solved
first
install TypeScript types
npm i --save-dev @types/react-burger-menu

then
add 'use client' on top of your component to use the react hooks

@Drakenwolf
Copy link

I have the same problem next.js 14, let me check the workrounds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants