Reputation: 3
I am trying to use context api in my app, the way i am trying to use is https://reactjs.org/docs/context.html#classcontexttype
here's a snack that I need to fix https://snack.expo.io/@mohmdalfaha/contexttype-example the context value is always undefined??
Upvotes: 0
Views: 259
Reputation: 485
There is error in your import in child component. As you are exporting AppContext as default you can't import in {}. You can import constant in {}. Here's a snack for that https://snack.expo.io/ByQkOVgXS
Upvotes: 1