import React, { Component } from "react";
import Item from "./components/Item";
import items from "./items.json";
import "./App.css";
class App extends Component {
state = {
items
};
render() {
return (
{this.state.items.map(item => (
<Item
id={item.id}
key={item.id}
name={item.name}
image={item.image}
/>
))}
);
}
}
export default App;
当我运行此代码时,我收到以下错误:App.js:这是一个保留字(17:11)。我该怎么做才能解决这个问题?