rajatk16 / infinity-war

3 stars 6 forks source link

Code is Broken #1

Open djnorrisdev opened 5 years ago

djnorrisdev commented 5 years ago

Received the below error when cloning and running your project in your React DnD tutorial:


./src/App/index.js
Syntax error: Unexpected token (13:6)

  11 | 
  12 | class App extends Component {
> 13 |   this.state = data;
     |       ^
  14 |   render() {
  15 |     return (
  16 |       <div>
This error occurred during the build time and cannot be dismissed.```
Matt-Hill-Harness commented 5 years ago

Here is the fix:

import React, { Component } from "react"; import data from "../Data"; import Column from "../Column"; import styled from "styled-components";

const Title = styled.div text-align: center; margin-top: 5px; padding: 10px; ;

class App extends Component { state = data; // this.state = data; render() { return (

<text>Avengers Infinity War</text> {this.state.columnsort.map(columnId => { const column = this.state.columns[columnId]; const heroes = column.heroId.map(heroId => this.state.heroes[heroId]); return ; })}
);

} }

export default App;