DEV Community

Discussion on: Using React Context for state management in Next.js

Collapse
 
georgemburu profile image
Georgemburu • Edited

Hello, you sure this will work?

export function useAppContext() {
return useContext(AppContext);
}

Since you are using a hook outside a react component

OOOOWWW!!
Sorry my bad.

Was using the hook inside jsx while i should be using it inside the body of the component.

Thanks alot for the post

Collapse
 
cassidoo profile image
Cassidy Williams

Glad you got it :)