I have a component ExpandableCard and created its context ExpandableCardContext and context provider ExpandableCardProvider. Then I called the provider from some ParentComponent by passing a prop "handleCloseExpandableCard"(an arrow function) and also another prop "component" have value a ChildComponent which gets called from ExpandableCard. The problem is that ChildComponent doesn't receive "handleCloseExpandableCard" as a prop.
ParentComponent

**ExpandableCardProvider
**

**ExpandableCardContext
**

ExpandableCard
it calls the component(ParcelCardProvider) passed from "ParentComponent" and that ParcelCardProvider is not receiving "handleCloseExpandCard" as a prop.

This is the Error I'm getting.

My Guess is that parcel card is being called as a prop outside that context but at the same time it's wrapped inside the Context Provider component. Anybody here with help?
Much Appreciated. Thanks.
I've resolved this one. I was trying to import handleCloseExpandableCard as
const [handleCloseExpandableCard] = useContext(ExpandableCardContext);
but actually it needed to be import like this
const [, , handleCloseExpandableCard] = useContext(ExpandableCardContext);