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

Element type Error when using with nextjs and redux-toolkit #333

Open
mohammad-reza-tajik opened this issue Dec 16, 2023 · 0 comments
Open

Comments

@mohammad-reza-tajik
Copy link

mohammad-reza-tajik commented Dec 16, 2023

hi. i'm using nextjs with redux-toolkit . i have a userAction.ts file that in it user adds an item to its cart and then receives a success notification and in that file i use toast object like this :

import toast from "react-hot-toast";


 dispatch(userActions.addToCart(productId));
 toast.success("added to your cart successfully")

and get this error :

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

@mohammad-reza-tajik mohammad-reza-tajik changed the title Error: Element type is invalid when using with nextjs and redux-toolkit Element type Error when using with nextjs and redux-toolkit Dec 16, 2023
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

1 participant