선생님 기능은 정상작동합니다

문제는 새로고침을 하면
이 화면이 자꾸 나와요
/////////////////////// App.js ////////////////////////////
/////////////////////// function App ////////////////////////////
useEffect(() => {
if (!localStorage.getItem("watched")) {
localStorage.setItem("watched", JSON.stringify([]));
}
}, []);
<Watch shoes={shoes} />
////////////////////// function App ////////////////////////////
////////////////////// function Watch////////////////////////////
function Watch(props) {
let watched = JSON.parse(localStorage.getItem("watched"));
return (
<ul className="show">
{watched.map((a) => (
<li key={a}>
<img
className="img"
src={`https://codingapple1.github.io/shop/shoes${a + 1}.jpg`}
/>
<h4>{props.shoes[a].title}</h4>
))}
);
}
////////////////////// function Watch////////////////////////////
/////////////////////// App.js ////////////////////////////
/////////////////////// Detail.js ////////////////////////////
if (확인 === -1) {
watched.push(찾은상품.id);
localStorage.setItem("watched", JSON.stringify(watched));
}
}, []);
/////////////////////// Detail.js ////////////////////////////
제가 수정한 부분들 코드만 올렸습니다
한번 봐주세요!