Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- useEffect(() => {
- AsyncStorage.getItem('bookmark')
- .then(data => {
- const parsedData = JSON.parse(data);
- if (parsedData?.length > 0) {
- setIsBookmarked(
- parsedData.findIndex(item => item.id === movieDetail.id) > -1,
- );
- }
- })
- .catch(error => console.log('error', error));
- }, [movieDetail.id]);
Advertisement
Add Comment
Please, Sign In to add comment