title: Warning: An effect function must not return anything besides a function, which is used for clean-up
body: <p>i cant find my mistake why should i use cleanup , and return anything when i am use useefect i just want to check if the user is logged in or not .. ?</p>
  <pre><code>useEffect(async () =&gt; {
      var item = await AsyncStorage.getItem(&quot;User&quot;);
      console.log(item);
      if (item == null || item == undefined) {
        props.navigation.navigate(&quot;Login&quot;);
      }
      else {
        var user = await JSON.parse(item);
        if(user.fullname==&quot;admin&quot;){
          props.navigation.navigate(&quot;AdminHP&quot;);
        }
        else{
          props.navigation.navigate(&quot;UserHP&quot;);
        }
      }
      console.log(&quot;effect&quot;);
      
    },[]);
  </code></pre>