안녕하세요!
코딩 독학하다가 도저히 혼자 해결이 안되어서 도움 요청드립니다..
public/image/~~~~
~~여기에 이미지를 다 저장해놓고
const Sidebar = () => {
return (
<div className='sidebar'>
<div className="top">
<Link to= "/" style={{textDecoration:"none"}}>
<span className="logo">
</span>
</Link>
이미지 경로를 위와 같이 경로 설정했습니다.
그리고 밑에는 라우팅 코드인데
<Routes>
<Route path="/">
<Route index element={<Home />} />
<Route path="login" element= {<Login/>}/>
<Route path="users">
<Route index element={<List />} />
<Route path=":userId" element= {<Single/>}/>
<Route path="new" element= {<New/>}/>
</Route>
<Route path="products">
<Route index element={<List />} />
<Route path=":productId" element= {<Single/>}/>
<Route path="new" element= {<New/>}/>
</Route>
http://localhost:3000/
http://localhost:3000/users
http://localhost:3000/login
http://localhost:3000/product 는 public 내의 이미지가 정상 출력되는데
---------------------------------------
http://localhost:3000/users/213123124
http://localhost:3000/users/new
http://localhost:3000/product/1232452
http://localhost:3000/product /new
그 이상 라우터 페이지로 갈 때는
이미지가 엑박이 뜨는데 어디에 문제가 있을까요? ㅠㅠ