Skip to content

"You're importing a component that needs useEffect" - ERROR #59857

Answered by ananuness
SimonKhalaf asked this question in Help

You must be logged in to vote

CountriesList.{js | jsx} needs to be a client component as it uses functions that need the browser enviroment (useState, UseEffect and fetch). And there's no problem to import a client component in a server one!

I hope it helps!

Replies: 3 comments 4 replies

You must be logged in to vote
4 replies
@mohit2404

@ananuness

@mohit2404

@ananuness

Answer selected by SimonKhalaf

You must be logged in to vote
0 replies

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
5 participants