undefined is not an object (evaluating ‘context._context’) in react-native

I was mistaken you are importing EmailContext it should be Emailcontext Your Email Verification component should look like this:

import React, {useContext, useState} from 'react';
import {Emailcontext} from '../ContextStore'

const EmailVerification = ({navigation}) => {
    const [emailAddress, setEmailAddress] = useContext(Emailcontext);
      **jsx element**
export default EmailVerification;

also you have made ContextStore a default export so when importing into your app.js ensure you are importing it like so:

import ContextStore from '...correct path'

I know you are using react-native but here is a code pen of a CRA, where I wrap the index.js in the provider and do the proper imports into app.js to emulate your EmailVerification component.


CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top