armadiazrino

Untitled

Jun 22nd, 2022
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. useEffect(() => {
  2. AsyncStorage.getItem('bookmark')
  3. .then(data => {
  4. const parsedData = JSON.parse(data);
  5. if (parsedData?.length > 0) {
  6. setIsBookmarked(
  7. parsedData.findIndex(item => item.id === movieDetail.id) > -1,
  8. );
  9. }
  10. })
  11. .catch(error => console.log('error', error));
  12. }, [movieDetail.id]);
Advertisement
Add Comment
Please, Sign In to add comment