Skip to content
Discussion options

You must be logged in to vote

Right, this is a server component, using async/await, and at the same time is trying to use a client side hook, such as useDispatch - to lay interactivity. That ain't gonna fly.

Please refer to, https://beta.nextjs.org/docs/rendering/server-and-client-components#when-to-use-server-vs-client-components:

So it is not only that dispatch won't work, but also the onClick won't work:

Replies: 3 comments 13 replies

Comment options

You must be logged in to vote
9 replies
@ritarpan-ghosh
Comment options

@icyJoseph
Comment options

@ritarpan-ghosh
Comment options

@icyJoseph
Comment options

Answer selected by ritarpan-ghosh
@arman-ebrahimi
Comment options

@Wendyooo7
Comment options

@Zubair72AR
Comment options

Comment options

You must be logged in to vote
4 replies
@artemis-prime
Comment options

@vishal590
Comment options

@Stianlars1
Comment options

@vishal590
Comment options

Comment options

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
10 participants