# Screen Component Issue

**URL:** <https://forum.codewithmosh.com/t/screen-component-issue/24707>\
**Category:** React Native\
**Created:** [January 22, 2024, 6:59pm UTC](https://forum.codewithmosh.com/t/screen-component-issue/24707 "2024-01-22T18:59:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![muhammadasad](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@muhammadasad](https://forum.codewithmosh.com/u/muhammadasad)\
**Post date:** [January 22, 2024, 6:59pm UTC](https://forum.codewithmosh.com/t/screen-component-issue/24707/1 "2024-01-22T18:59:32Z")

</div>

This error is located at:  
in App (created by withDevTools(App))  
in withDevTools(App)  
in RCTView (created by View)  
in View (created by AppContainer)  
in RCTView (created by View)  
in View (created by AppContainer)  
in AppContainer  
in main(RootComponent), js engine: hermes

```auto
import React , {useEffect} from 'react';
import * as ImagePicker from 'expo-image-picker';

import {Screen} from './app/components/Screen';

const requestPermission = async () => {    
    const result = await ImagePicker.requestCameraPermissionsAsync();
    
}

export default function App(props) {   
    useEffect(() => {
        requestPermission();
    }, []) ;
    
    return (
        <Screen></Screen>
    );
}

```

---

<div class="post-metadata">

**Author:** ![Harvel](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/harvel/32/7651_2.png) [@Harvel](https://forum.codewithmosh.com/u/Harvel)\
**Post date:** [January 23, 2024, 6:38am UTC](https://forum.codewithmosh.com/t/screen-component-issue/24707/2 "2024-01-23T06:38:33Z")

</div>

Try defining the requestPermission function inside the body of the App component

---

<div class="post-metadata">

**Author:** ![Harvel](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/harvel/32/7651_2.png) [@Harvel](https://forum.codewithmosh.com/u/Harvel)\
**Post date:** [January 23, 2024, 6:40am UTC](https://forum.codewithmosh.com/t/screen-component-issue/24707/3 "2024-01-23T06:40:04Z")

</div>

Could you also provide a screen shot of the error stack in the console,
