Skip to content

TypeError: (0 , _react.createContext) is not a function on Nextjs using Redux #49074

Answered by icyJoseph
ritarpan-ghosh asked this question in Help
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: 2 comments 7 replies

Comment options

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

@icyJoseph
Comment options

@ritarpan-ghosh
Comment options

@icyJoseph
Comment options

Answer selected by ritarpan-ghosh
Comment options

You must be logged in to vote
1 reply
@artemis-prime
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants