3 글 보임 - 1 에서 3 까지 (총 3 중에서)
-
글쓴이글
-
2023년 9월 18일 11:06 #98316
김수현참가자선생님~ 이런 에러가 뜨는데요. 익스포트, 임포트, shoes오타 등 찾아봤는데 그래도 안되네요...ㅜㅜ
ERROR in [eslint] src\App.js Line 40:18: 'shoes' is not defined no-undef
Search for the keywords to learn more about each error.
webpack compiled with 1 error and 1 warning <!--more-->
아래는 App.js 파일입니다. import { useState } from 'react'; import { Button, Navbar, Container, Nav } from 'react-bootstrap'; import Row from 'react-bootstrap/Row'; import Col from 'react-bootstrap/Col'; import './App.css'; import data from './data.js';
function App() {
let [shoes] = useState(data) console.log(shoes) return ( <div className="App"> <Navbar bg="dark" data-bs-theme="dark"> <Container> <Navbar.Brand href="#home">Navbar</Navbar.Brand> <Nav className="me-auto"> <Nav.Link href="#home">Home</Nav.Link> <Nav.Link href="#features">Features</Nav.Link> <Nav.Link href="#pricing">Pricing</Nav.Link> </Nav> </Container> </Navbar> <div className="main-bg"></div> <ResponsiveAutoExample />
</div> ); }
function ResponsiveAutoExample() { return ( <> <Container> <Row> <Col sm> {/* < img src={process.env.PUBLIC_URL + '/logo192.png'} /> */} < img src="https://codingapple1.github.io/shop/shoes1.jpg" width="80%" /> <h4>{shoes}</h4> <p>상품설명</p>
</Col> <Col sm> < img src="https://codingapple1.github.io/shop/shoes2.jpg" width="80%" /> <h4>상품명</h4> <p>상품설명</p> </Col> <Col sm> < img src="https://codingapple1.github.io/shop/shoes3.jpg" width="80%" /> <h4>상품명</h4> <p>상품설명</p> </Col> </Row> </Container> </> ); } export default App;
아래는 data.js 파일입니다. let data = [ { id: 0, title: "White and Black", content: "Born in France", price: 120000 },
{ id: 1, title: "Red Knit", content: "Born in Seoul", price: 110000 },
{ id: 2, title: "Grey Yordan", content: "Born in the States", price: 130000 } ]
export default data;
화면 캡처입니다.
-
글쓴이글
3 글 보임 - 1 에서 3 까지 (총 3 중에서)
- 답변은 로그인 후 가능합니다.