"'这'是一个保留的关键字"在React app中,为什么?

时间:2018-04-04 17:38:33

标签: reactjs this keyword reserved

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)。我该怎么做才能解决这个问题?

0 个答案:

没有答案