# React Issues with Camper Leaderboard

**URL:** <https://forum.freecodecamp.org/t/react-issues-with-camper-leaderboard/177051>\
**Category:** General\
**Created:** [February 27, 2018, 10:30pm UTC](https://forum.freecodecamp.org/t/react-issues-with-camper-leaderboard/177051 "2018-02-27T22:30:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thisiswhale](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/thisiswhale/32/76832_2.png) [@thisiswhale](https://forum.freecodecamp.org/u/thisiswhale)\
**Post date:** [February 27, 2018, 10:30pm UTC](https://forum.freecodecamp.org/t/react-issues-with-camper-leaderboard/177051/1 "2018-02-27T22:30:41Z")

</div>

I’m having a strange error whenever I run with webpack and babel with my Atom editor.  
The error revolves around `renderTable()` method.

So building with webpack:

```auto
  constructor() {
    super();
    this.state = {
      topAllTime: [],
      top30Days: []
    }
    this.renderTable = this.renderTable.bind(this);
  }
  renderTable() {
    return (this.state.topAllTime.map((user, i) => {
      return (<tbody className='user-row'>
        <tr className='camper' key={user.id}>
          <th className='key'>{user.id}</th>
          <th className='username'><img src={user.img} style={styles.image}/> {user.username}</th>
          <th className='recent'>{user.recentPoints}</th>
          <th className='all-time'>{user.allTimePoints}</th>
        </tr>
      </tbody>)
    })
    );
  }

```

I get this error

 ![Capture](https://global.discourse-cdn.com/freecodecamp/original/3X/4/7/47d05b51bb923ac9776daa60bae70ffaef4c8b1b.JPG)

If I want to bind with ES6 method like so:

```auto
 renderTable = ()=>{
    return ( this.state.topAllTime.map((user, i) => {
      return (<tbody className='user-row'>
        <tr className='camper' key={user.id}>
          <th className='key'>{user.id}</th>
          <th className='username'><img src={user.img} style={styles.image}/> {user.username}</th>
          <th className='recent'>{user.recentPoints}</th>
          <th className='all-time'>{user.allTimePoints}</th>
        </tr>
      </tbody>)
    })
    )
  }

```

I get unexpected token, when I’m sure this is correct.

 ![Capture](https://global.discourse-cdn.com/freecodecamp/original/3X/0/f/0f4a52380b592c9e7ddcc604a35d59841960ad34.JPG)

And it did on [https://codesandbox.io/s/7y3y1rppjq](https://codesandbox.io/s/7y3y1rppjq), works well and shows no errors.

I’m guessing it might be my webpack being weird, but everything looks right.

```auto
module.exports = {
  entry: "./app/App.js",

  output: {
    filename: "public/bundle.js"
  },
  module: {
    loaders: [
      {
        test: /\.jsx?$/,
        include: /app/,
        loader: "babel",
        query: {
          presets: ["react", "es2015"]
        }
      }
    ]
  },
  devtool: "eval-source-map"
};

```

---

<div class="post-metadata">

**Author:** ![JohnnyBizzel](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/johnnybizzel/32/37661_2.png) [@JohnnyBizzel](https://forum.freecodecamp.org/u/JohnnyBizzel)\
**Post date:** [March 5, 2018, 1:04pm UTC](https://forum.freecodecamp.org/t/react-issues-with-camper-leaderboard/177051/2 "2018-03-05T13:04:00Z")

</div>

Try just `renderTable () { ...`

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:25pm UTC](https://forum.freecodecamp.org/t/react-issues-with-camper-leaderboard/177051/3 "2021-01-17T20:25:11Z")

</div>

Closed on January 17, 2021, 8:25pm UTC


