Failed to compile.
src\index.js
Line 10:13: 'createStore' is not defined no-undef
Search for the keywords to learn more about each error.
이렇게 오류가 뜨는데 이유가 무엇일까요???
1. index.js
import {Provider} from 'react-redux';
let store = createStore(()=>{return [{id : 0, name : '멋진신발', quan: 2}] });
ReactDOM.render(
<React.StrictMode>
<BrowserRouter>
<Provider store={store}>
<App />
</Provider>
</BrowserRouter>
</React.StrictMode>,
document.getElementById('root')
);
2. Cart. js
import React from 'react';
import {Table} from 'react-bootstrap';
import { connect } from 'react-redux';
function Cart(props){
return(
<div>
<Table responsive>
<thead>
<tr>
<th>#</th>
<th>상품명</th>
<th>수량</th>
<th>변경</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>{props.state[0].name}</td>
<td>Table cell</td>
<td>Table cell</td>
</tr>
</tbody>
</Table>
</div>
)
}
function 함수명(state){
return {
state : state
}
}
export default connect(함수명)(Cart);
// export default Cart;