0

I have a problem with useContext because it returns undefined to me. could you please help me?

Uncaught TypeError: Cannot destructure property 'course' of 'Object(...)(...)' as it is undefined.

enter image description here

enter image description here

enter image description here

enter image description here

asked Oct 28, 2021 at 9:08
1
  • 2
    you need to use useContext(courseGlobal) not the ContextCourse which is actually your Provider, not your Context Commented Oct 28, 2021 at 9:11

1 Answer 1

1

courseGlobal is your context. you should pass courseGlobal to useContext but you are passing ContextCourse that is a provider not a context

answered Oct 28, 2021 at 9:13
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.