TypeError: useContext is not a function or its return value is not iterable
I create a model component for reuse. I got "TypeError: useContext is not a function or its return value is not iterable" error. How to solve this error. This code is in single file.
Error happening in
const [{ show, hide }] = useContext(ModelPUp);
line4 Replies
The code composing together the components is external to this file.
Assuming everything else is working:
ModalPUp
is undefined
until the ModalPopUp
executes. If any of the other Modal*
components run beforehand ModalPUp
will still be undefined
.Yeas everything else is working. What should I do for that?
In broad strokes:
Thanks I will check it