# TypeError: undefined is not an object (evaluating '\_useFormikContext.handleSubmit')

**URL:** <https://forum.codewithmosh.com/t/typeerror-undefined-is-not-an-object-evaluating-useformikcontext-handlesubmit/11677>\
**Category:** React Native\
**Created:** [April 2, 2022, 7:37pm UTC](https://forum.codewithmosh.com/t/typeerror-undefined-is-not-an-object-evaluating-useformikcontext-handlesubmit/11677 "2022-04-02T19:37:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DataX](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@DataX](https://forum.codewithmosh.com/u/DataX)\
**Post date:** [April 2, 2022, 7:37pm UTC](https://forum.codewithmosh.com/t/typeerror-undefined-is-not-an-object-evaluating-useformikcontext-handlesubmit/11677/1 "2022-04-02T19:37:13Z")

</div>

App.js  
`  
import React, { useState } from “react”;  
import LoginScreen from “./app/screens/LoginScreen”;

export default function App() {  
return ;  
}

```auto
LoginScreen.js

```

import React, { useState } from ‘react’;  
import { StyleSheet, Image } from ‘react-native’;  
import AppTextInput from ‘…/components/AppTextInput’;

import Screen from ‘…/components/Screen’;  
import SubmitButton from ‘…/components/SubmitButton’;

function LoginScreen(props) {  
const [email, setEmail] = useState();  
const [password, setPassword] = useState();

```
return (
    <Screen>
        <Image
            style={styles.logo}
            source={require("../assets/logo-red.png")} />
        <AppTextInput
            autoCapitalize="none"
            autoCorrect={false}
            icon="email"
            keyboardType="email-address"
            name="email"
            placeholder="Email "
            // iOS only feature from keychain
            textContentType="emailAddress"
        />
        <AppTextInput
            autoCapitalize="none"
            autoCorrect={false}
            icon="lock"
            name="password"
            placeholder="Password "
            secureTextEntry
            textContentType="password"
        />
        <SubmitButton title="Login" />
    </Screen>
);

```

}

const styles = StyleSheet.create({  
container: {  
padding: 10,  
},  
logo: {  
width: 80,  
height: 80,  
alignSelf: “center”,  
marginTop: 50,  
marginBottom: 20,  
},  
})  
export default LoginScreen;  
`AppButton.js`  
import React from “react”;  
import { StyleSheet, Text, TouchaleOpacity } from “react-native”;

import colors from “…/config/colors”;

function AppButton({ title, onPress, color = “primary” }) {  
return (  
\<TouchaleOpacity style={[styles.button, { backgroundColor: colors[color] }]} onPress={onPress}\>  
{title}  
  
)  
}

const styles = StyleSheet.create({  
button: {  
backgroundColor: colors.primary,  
borderRadius: 25,  
justifyContent: “center”,  
alignItems: “center”,  
padding: 15,  
marginVertical: 10,  
},  
text: {  
color: colors.white,  
fontSize: 18,  
},  
})  
`  
SubmitButton.js

```auto
import React from "react";
import { StyleSheet, Text, TouchaleOpacity } from "react-native";

import colors from "../config/colors";

function AppButton({ title, onPress, color = "primary" }) {
    return (
        <TouchaleOpacity style={[styles.button, { backgroundColor: colors[color] }]} onPress={onPress}>
            <Text style={StyleSheet.text}>{title}</Text>
        </TouchaleOpacity>
    )
}

const styles = StyleSheet.create({
    button: {
        backgroundColor: colors.primary,
        borderRadius: 25,
        justifyContent: "center",
        alignItems: "center",
        padding: 15,
        marginVertical: 10,
    },
    text: {
        color: colors.white,
        fontSize: 18,
    },
})

```

Having problem with line 36 of LoginScreen.js
