AsyncStorage.getItem is giving this error in react native when added in useEffect what am I doing wrong here can anyone pls help me understand the error.
export default function Pregent_login(props) {
const [first, setfirst] = useState();
useEffect(() => {
console.log('route.params ==>', props.route.params);
const value = AsyncStorage.getItem('token');
setfirst(value);
}, []);
2
Answers
Please try using this way
More details Here
Check the below code: