Caught Error error while using useEffect react native HOOks

53 Views Asked by At

so i am trying to use async storage and trying to validate if their is data in Async or not.. here is my code here is the error

i am not able to validate through...

1

There are 1 best solutions below

0
On BEST ANSWER

You should move calling the hook outside of your code

   const readData = ...


   useEffect(() => {
     const timeout = setTimeout(() => readData(), 5000)
     return () => { clearTimeout(timeout) }
   }, [])


Next time post code questions with code.