boa noite, preciso de uma ajuda estou tendo problemas ao abrir no navegador o projeto da aula, no devtools aparece a mensagem seguinte:
Uncaught TypeError: Cannot read properties of undefined (reading 'some') at Card (index.js:26:1) at renderWithHooks (react-dom.development.js:16305:1) at mountIndeterminateComponent (react-dom.development.js:20074:1) at beginWork (react-dom.development.js:21587:1) at beginWork$1 (react-dom.development.js:27426:1) at performUnitOfWork (react-dom.development.js:26557:1) at workLoopSync (react-dom.development.js:26466:1) at renderRootSync (react-dom.development.js:26434:1) at recoverFromConcurrentError (react-dom.development.js:25850:1) at performConcurrentWorkOnRoot (react-dom.development.js:25750:1)
e a tela fica em branco
o código do card esta assim:
import { useFavoritoContext } from 'contextos/Favoritos';
import styles from './Card.module.css';
import iconeFavoritar from './favoritar.png'
import iconeDesfavoritar from './desfavoritar.png'
function Card({id, titulo, capa}){
const { favorito, adicionarFavorito } = useFavoritoContext();
const ehFavorito = favorito.some((fav) => fav.id === id);
const icone = !ehFavorito ? iconeFavoritar : iconeDesfavoritar;
return(
<div className={styles.container}>
<img src={capa} alt={titulo} className={styles.capa}/>
<h2>{titulo}</h2>
<img src={icone} alt='Favoritar Filme' className={styles.favoritar}
onClick={() => {
adicionarFavorito ({id, titulo, capa})
}}/>
</div>
)
}
export default Card;