Skip to content
Advertisement

Maximum Call Stack Size exceeded and ENOENT error while using context

I get this error whenever I try to use React context,provider or useContext, any of them causes this

On App:

JavaScript

On terminal:

JavaScript

Advertisement

Answer

Path to context is wrong.

Basically I import ContextFile.js to index.js, and from index.js access to many things. index.js was importing Context from itself, and not from ContextFile.

At fist when I corrected the files, it didn’t work, I don’t know while, I even restarted with npx react-native start

Big Thanks to @Bergi, what he said helped me a lot to solve it. Sadly I don’t know how to tag or message him.

I hope this helps someone else…

image showing how i structure my files

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement